diff --git a/Cargo.lock b/Cargo.lock index bcc56df3..73cd0bd1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1288,6 +1288,7 @@ version = "0.13.0" dependencies = [ "ethers-core", "ethers-solc", + "getrandom 0.2.7", "reqwest", "semver", "serde", diff --git a/ethers-etherscan/Cargo.toml b/ethers-etherscan/Cargo.toml index 4927047a..d84f9c9d 100644 --- a/ethers-etherscan/Cargo.toml +++ b/ethers-etherscan/Cargo.toml @@ -23,6 +23,10 @@ thiserror = "1.0" tracing = "0.1.35" semver = "1.0.10" +[target.'cfg(target_arch = "wasm32")'.dependencies] +# NOTE: this enables wasm compatibility for getrandom indirectly +getrandom = { version = "0.2", features = ["js"] } + [dev-dependencies] tempfile = "3.3.0" tokio = { version = "1.18", features = ["macros", "rt-multi-thread", "time"] }