From f3c1606d1c5d33021312cfbdea8a8393137122fe Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 4 Sep 2024 13:21:47 +0200 Subject: [PATCH 01/57] cherrypick approved-contracts without integration tests --- Cargo.lock | 164 +- Cargo.toml | 172 +- pallets/asset-registry/Cargo.toml | 35 +- pallets/asset-registry/src/lib.rs | 27 +- pallets/asset-registry/src/tests/evm.rs | 114 + pallets/asset-registry/src/tests/mock.rs | 12 +- pallets/asset-registry/src/tests/mod.rs | 1 + pallets/asset-registry/src/types.rs | 3 + pallets/currencies/Cargo.toml | 29 +- pallets/currencies/src/fungibles.rs | 137 +- pallets/currencies/src/lib.rs | 136 +- pallets/currencies/src/mock.rs | 109 +- pallets/evm-accounts/src/benchmarking.rs | 23 + pallets/evm-accounts/src/lib.rs | 55 +- pallets/evm-accounts/src/weights.rs | 20 + pallets/transaction-multi-payment/src/lib.rs | 2 +- primitives/src/lib.rs | 3 + runtime/hydradx/src/assets.rs | 3 + runtime/hydradx/src/evm/erc20_currency.rs | 272 + .../hydradx/src/evm/evm-utility/Cargo.toml | 28 +- runtime/hydradx/src/evm/executor.rs | 69 + runtime/hydradx/src/evm/mod.rs | 11 +- .../src/evm/precompiles/erc20_mapping.rs | 2 +- runtime/hydradx/src/evm/precompiles/mod.rs | 4 +- .../src/evm/precompiles/multicurrency.rs | 130 +- .../src/weights/pallet_evm_accounts.rs | 20 +- runtime/hydradx/src/xcm.rs | 6 + scripts/test-contracts/.gitignore | 20 + scripts/test-contracts/README.md | 3 + .../contracts/HydraToken.sol/HydraToken.json | 324 + .../test-contracts/contracts/HydraToken.sol | 10 + scripts/test-contracts/hardhat.config.js | 6 + scripts/test-contracts/package-lock.json | 7694 +++++++++++++++++ scripts/test-contracts/package.json | 18 + traits/src/evm.rs | 58 +- traits/src/registry.rs | 9 +- 36 files changed, 9349 insertions(+), 380 deletions(-) create mode 100644 pallets/asset-registry/src/tests/evm.rs create mode 100644 runtime/hydradx/src/evm/erc20_currency.rs create mode 100644 runtime/hydradx/src/evm/executor.rs create mode 100644 scripts/test-contracts/.gitignore create mode 100644 scripts/test-contracts/README.md create mode 100644 scripts/test-contracts/artifacts/contracts/HydraToken.sol/HydraToken.json create mode 100644 scripts/test-contracts/contracts/HydraToken.sol create mode 100644 scripts/test-contracts/hardhat.config.js create mode 100644 scripts/test-contracts/package-lock.json create mode 100644 scripts/test-contracts/package.json diff --git a/Cargo.lock b/Cargo.lock index 12035b11c..f65b7b9b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -927,7 +927,7 @@ name = "binary-merkle-tree" version = "13.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", ] @@ -3189,24 +3189,6 @@ dependencies = [ "tiny-keccak", ] -[[package]] -name = "ethereum" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89fb87a9e103f71b903b80b670200b54cc67a07578f070681f1fffb7396fb7" -dependencies = [ - "bytes", - "ethereum-types", - "hash-db 0.15.2", - "hash256-std-hasher", - "parity-scale-codec", - "rlp", - "scale-info", - "serde", - "sha3", - "triehash", -] - [[package]] name = "ethereum" version = "0.15.0" @@ -3215,7 +3197,7 @@ checksum = "2e04d24d20b8ff2235cffbf242d5092de3aa45f77c5270ddbfadd2778ca13fea" dependencies = [ "bytes", "ethereum-types", - "hash-db 0.16.0", + "hash-db", "hash256-std-hasher", "parity-scale-codec", "rlp", @@ -3279,26 +3261,6 @@ dependencies = [ "pin-project-lite 0.2.13", ] -[[package]] -name = "evm" -version = "0.36.0" -source = "git+https://github.com/rust-blockchain/evm?rev=13240a8a551586fdef0b5028ed73af80b248092a#13240a8a551586fdef0b5028ed73af80b248092a" -dependencies = [ - "auto_impl", - "environmental", - "ethereum 0.14.0", - "evm-core 0.36.0", - "evm-gasometer 0.36.0", - "evm-runtime 0.36.0", - "log", - "parity-scale-codec", - "primitive-types", - "rlp", - "scale-info", - "serde", - "sha3", -] - [[package]] name = "evm" version = "0.41.1" @@ -3306,10 +3268,10 @@ source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkado dependencies = [ "auto_impl", "environmental", - "ethereum 0.15.0", - "evm-core 0.41.0", - "evm-gasometer 0.41.0", - "evm-runtime 0.41.0", + "ethereum", + "evm-core", + "evm-gasometer", + "evm-runtime", "log", "parity-scale-codec", "primitive-types", @@ -3319,17 +3281,6 @@ dependencies = [ "sha3", ] -[[package]] -name = "evm-core" -version = "0.36.0" -source = "git+https://github.com/rust-blockchain/evm?rev=13240a8a551586fdef0b5028ed73af80b248092a#13240a8a551586fdef0b5028ed73af80b248092a" -dependencies = [ - "parity-scale-codec", - "primitive-types", - "scale-info", - "serde", -] - [[package]] name = "evm-core" version = "0.41.0" @@ -3341,40 +3292,17 @@ dependencies = [ "serde", ] -[[package]] -name = "evm-gasometer" -version = "0.36.0" -source = "git+https://github.com/rust-blockchain/evm?rev=13240a8a551586fdef0b5028ed73af80b248092a#13240a8a551586fdef0b5028ed73af80b248092a" -dependencies = [ - "environmental", - "evm-core 0.36.0", - "evm-runtime 0.36.0", - "primitive-types", -] - [[package]] name = "evm-gasometer" version = "0.41.0" source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkadot-v1.7.2#d8991ec727ad0fb64fe9957a3cd307387a6701e4" dependencies = [ "environmental", - "evm-core 0.41.0", - "evm-runtime 0.41.0", + "evm-core", + "evm-runtime", "primitive-types", ] -[[package]] -name = "evm-runtime" -version = "0.36.0" -source = "git+https://github.com/rust-blockchain/evm?rev=13240a8a551586fdef0b5028ed73af80b248092a#13240a8a551586fdef0b5028ed73af80b248092a" -dependencies = [ - "auto_impl", - "environmental", - "evm-core 0.36.0", - "primitive-types", - "sha3", -] - [[package]] name = "evm-runtime" version = "0.41.0" @@ -3382,7 +3310,7 @@ source = "git+https://github.com/moonbeam-foundation/evm?branch=moonbeam-polkado dependencies = [ "auto_impl", "environmental", - "evm-core 0.41.0", + "evm-core", "primitive-types", "sha3", ] @@ -3554,9 +3482,9 @@ name = "fc-rpc" version = "2.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", - "evm 0.41.1", + "evm", "fc-api", "fc-mapping-sync", "fc-rpc-core", @@ -3609,7 +3537,7 @@ name = "fc-rpc-core" version = "1.1.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "jsonrpsee 0.20.3", "rlp", @@ -3624,7 +3552,7 @@ name = "fc-storage" version = "1.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-rpc", "fp-storage", @@ -3812,7 +3740,7 @@ name = "fp-consensus" version = "2.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "parity-scale-codec", "sp-core", "sp-runtime", @@ -3824,7 +3752,7 @@ name = "fp-ethereum" version = "1.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-evm", "frame-support", @@ -3837,7 +3765,7 @@ name = "fp-evm" version = "3.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "evm 0.41.1", + "evm", "frame-support", "num_enum 0.7.2", "parity-scale-codec", @@ -3853,7 +3781,7 @@ name = "fp-rpc" version = "3.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ - "ethereum 0.15.0", + "ethereum", "ethereum-types", "fp-evm", "parity-scale-codec", @@ -4545,12 +4473,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "hash-db" -version = "0.15.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d23bd4e7b5eda0d0f3a307e8b381fdc8ba9000f26fbe912250c0a4cc3956364a" - [[package]] name = "hash-db" version = "0.16.0" @@ -4949,7 +4871,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "ethabi", - "evm 0.41.1", + "evm", "fp-evm", "fp-rpc", "fp-self-contained", @@ -6558,7 +6480,7 @@ version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "808b50db46293432a45e63bc15ea51e0ab4c0a1647b8eb114e31a3e698dd6fbe" dependencies = [ - "hash-db 0.16.0", + "hash-db", ] [[package]] @@ -6726,10 +6648,10 @@ dependencies = [ name = "module-evm-utility" version = "2.21.0" dependencies = [ - "ethereum 0.14.0", - "evm 0.36.0", - "evm-gasometer 0.36.0", - "evm-runtime 0.36.0", + "ethereum", + "evm", + "evm-gasometer", + "evm-runtime", "sha3", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2)", ] @@ -7506,6 +7428,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", + "hex-literal 0.4.1", "hydradx-traits", "log", "orml-tokens", @@ -7923,6 +7846,7 @@ version = "2.1.1" dependencies = [ "frame-support", "frame-system", + "hydradx-traits", "orml-tokens", "orml-traits", "orml-utilities", @@ -8168,9 +8092,9 @@ version = "4.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ "environmental", - "ethereum 0.15.0", + "ethereum", "ethereum-types", - "evm 0.41.1", + "evm", "fp-consensus", "fp-ethereum", "fp-evm", @@ -8192,13 +8116,13 @@ version = "6.0.0-dev" source = "git+https://github.com/moonbeam-foundation/frontier?branch=moonbeam-polkadot-v1.7.2#91f1c7a447f987d732f87f86c3e02d506d426a99" dependencies = [ "environmental", - "evm 0.41.1", + "evm", "fp-account", "fp-evm", "frame-benchmarking", "frame-support", "frame-system", - "hash-db 0.16.0", + "hash-db", "hex", "hex-literal 0.4.1", "impl-trait-for-tuples", @@ -8273,7 +8197,7 @@ name = "pallet-evm-precompile-call-permit" version = "0.1.1" dependencies = [ "derive_more", - "evm 0.41.1", + "evm", "fp-evm", "frame-support", "frame-system", @@ -10975,7 +10899,7 @@ dependencies = [ "affix", "derive_more", "environmental", - "evm 0.41.1", + "evm", "fp-evm", "frame-support", "frame-system", @@ -11949,6 +11873,7 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "hex", "hex-literal 0.4.1", "hydradx-adapters", "hydradx-runtime", @@ -12016,6 +11941,7 @@ dependencies = [ "rococo-runtime", "sc-consensus-grandpa", "scraper", + "serde_json", "sp-api", "sp-authority-discovery", "sp-block-builder", @@ -12449,7 +12375,7 @@ name = "sc-client-db" version = "0.35.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ - "hash-db 0.16.0", + "hash-db", "kvdb", "kvdb-memorydb", "kvdb-rocksdb", @@ -14096,7 +14022,7 @@ name = "sp-api" version = "26.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "scale-info", @@ -14329,7 +14255,7 @@ dependencies = [ "dyn-clonable", "ed25519-zebra 3.1.0", "futures", - "hash-db 0.16.0", + "hash-db", "hash256-std-hasher", "impl-serde", "itertools 0.10.5", @@ -14749,7 +14675,7 @@ name = "sp-state-machine" version = "0.35.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ - "hash-db 0.16.0", + "hash-db", "log", "parity-scale-codec", "parking_lot 0.12.1", @@ -14893,7 +14819,7 @@ version = "29.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ "ahash 0.8.6", - "hash-db 0.16.0", + "hash-db", "lazy_static", "memory-db", "nohash-hasher", @@ -16011,7 +15937,7 @@ version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff28e0f815c2fea41ebddf148e008b077d2faddb026c9555b29696114d602642" dependencies = [ - "hash-db 0.16.0", + "hash-db", "hashbrown 0.13.2", "log", "rustc-hex", @@ -16024,17 +15950,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4ed310ef5ab98f5fa467900ed906cb9232dd5376597e00fd4cba2a449d06c0b" dependencies = [ - "hash-db 0.16.0", -] - -[[package]] -name = "triehash" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1631b201eb031b563d2e85ca18ec8092508e262a3196ce9bd10a67ec87b9f5c" -dependencies = [ - "hash-db 0.15.2", - "rlp", + "hash-db", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index f2af9f50e..c170ffbf9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,46 +3,46 @@ panic = 'unwind' [workspace] members = [ - 'node', - 'runtime/hydradx', - 'pallets/omnipool', - 'pallets/dca', - 'primitives', - 'utils/build-script-utils', - 'integration-tests', - 'pallets/circuit-breaker', - 'pallets/omnipool-liquidity-mining', - 'scraper', - 'traits', - 'pallets/relaychain-info', - 'pallets/route-executor', - 'pallets/transaction-multi-payment', - 'pallets/asset-registry', - 'runtime/adapters', - 'pallets/collator-rewards', - 'pallets/transaction-pause', - 'pallets/ema-oracle', - 'pallets/liquidity-mining', - 'pallets/currencies', - 'pallets/stableswap', - 'utils/test-utils', - 'pallets/dynamic-fees', - 'pallets/duster', - 'pallets/otc', - 'pallets/otc-settlements', - 'pallets/bonds', - 'pallets/lbp', - 'pallets/nft', - 'math', - 'pallets/staking', - 'pallets/democracy', - 'runtime/hydradx/src/evm/evm-utility/macro', - 'pallets/referrals', - 'pallets/evm-accounts', - 'pallets/dynamic-evm-fee', - 'pallets/xyk-liquidity-mining', - 'precompiles/call-permit', - 'runtime-mock' + 'node', + 'runtime/hydradx', + 'pallets/omnipool', + 'pallets/dca', + 'primitives', + 'utils/build-script-utils', + 'integration-tests', + 'pallets/circuit-breaker', + 'pallets/omnipool-liquidity-mining', + 'scraper', + 'traits', + 'pallets/relaychain-info', + 'pallets/route-executor', + 'pallets/transaction-multi-payment', + 'pallets/asset-registry', + 'runtime/adapters', + 'pallets/collator-rewards', + 'pallets/transaction-pause', + 'pallets/ema-oracle', + 'pallets/liquidity-mining', + 'pallets/currencies', + 'pallets/stableswap', + 'utils/test-utils', + 'pallets/dynamic-fees', + 'pallets/duster', + 'pallets/otc', + 'pallets/otc-settlements', + 'pallets/bonds', + 'pallets/lbp', + 'pallets/nft', + 'math', + 'pallets/staking', + 'pallets/democracy', + 'runtime/hydradx/src/evm/evm-utility/macro', + 'pallets/referrals', + 'pallets/evm-accounts', + 'pallets/dynamic-evm-fee', + 'pallets/xyk-liquidity-mining', + 'precompiles/call-permit', + 'runtime-mock' ] resolver = "2" @@ -58,12 +58,12 @@ derive_more = "0.99" affix = "0.1.2" similar-asserts = "1.1.0" impl-trait-for-tuples = "0.2.1" -environmental = {version = "1.1.2", default-features = false} -hex = {version = "0.4.3", default-features = false} -sha3 = {version = "0.10", default-features = false} -serde = {version = "1.0.101", default-features = false} -libsecp256k1 = {version = "0.7", default-features = false} -num_enum = {version = "0.5.3", default-features = false} +environmental = { version = "1.1.2", default-features = false } +hex = { version = "0.4.3", default-features = false } +sha3 = { version = "0.10", default-features = false } +serde = { version = "1.0.101", default-features = false } +libsecp256k1 = { version = "0.7", default-features = false } +num_enum = { version = "0.5.3", default-features = false } hydra-dx-math = { path = "math", default-features = false } hydradx = { path = "node", default-features = false } hydradx-traits = { path = "traits", default-features = false } @@ -87,23 +87,23 @@ pallet-liquidity-mining = { path = "pallets/liquidity-mining", default-features pallet-nft = { path = "pallets/nft", default-features = false } pallet-omnipool = { path = "pallets/omnipool", default-features = false } pallet-omnipool-liquidity-mining = { path = "pallets/omnipool-liquidity-mining", default-features = false } -pallet-otc = { path = "pallets/otc", default-features = false} -pallet-otc-settlements = { path = "pallets/otc-settlements", default-features = false} +pallet-otc = { path = "pallets/otc", default-features = false } +pallet-otc-settlements = { path = "pallets/otc-settlements", default-features = false } pallet-relaychain-info = { path = "pallets/relaychain-info", default-features = false } pallet-route-executor = { path = "pallets/route-executor", default-features = false } pallet-stableswap = { path = "pallets/stableswap", default-features = false } pallet-transaction-multi-payment = { path = "pallets/transaction-multi-payment", default-features = false } pallet-transaction-pause = { path = "pallets/transaction-pause", default-features = false } pallet-staking = { path = "pallets/staking", default-features = false } -pallet-democracy= { path = "pallets/democracy", default-features = false } +pallet-democracy = { path = "pallets/democracy", default-features = false } warehouse-liquidity-mining = { package = "pallet-liquidity-mining", path = "pallets/liquidity-mining", default-features = false } -pallet-bonds = { path = "pallets/bonds", default-features = false} -pallet-lbp = { path = "pallets/lbp", default-features = false} -pallet-xyk = { path = "pallets/xyk", default-features = false} -pallet-xyk-liquidity-mining = { path = "pallets/xyk-liquidity-mining", default-features = false} -pallet-referrals = { path = "pallets/referrals", default-features = false} -pallet-evm-accounts = { path = "pallets/evm-accounts", default-features = false} -pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false} +pallet-bonds = { path = "pallets/bonds", default-features = false } +pallet-lbp = { path = "pallets/lbp", default-features = false } +pallet-xyk = { path = "pallets/xyk", default-features = false } +pallet-xyk-liquidity-mining = { path = "pallets/xyk-liquidity-mining", default-features = false } +pallet-referrals = { path = "pallets/referrals", default-features = false } +pallet-evm-accounts = { path = "pallets/evm-accounts", default-features = false } +pallet-evm-accounts-rpc-runtime-api = { path = "pallets/evm-accounts/rpc/runtime-api", default-features = false } hydra-dx-build-script-utils = { path = "utils/build-script-utils", default-features = false } scraper = { path = "scraper", default-features = false } @@ -112,8 +112,8 @@ test-utils = { path = "utils/test-utils", default-features = false } integration-tests = { path = "integration-tests", default-features = false } -pallet-evm-precompile-call-permit = { path ="precompiles/call-permit", default-features = false } -precompile-utils = { path ="precompiles/utils", default-features = false } +pallet-evm-precompile-call-permit = { path = "precompiles/call-permit", default-features = false } +precompile-utils = { path = "precompiles/utils", default-features = false } # Codec codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false, features = ["derive"] } @@ -125,7 +125,7 @@ frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branc frame-benchmarking-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } frame-executive = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } frame-remote-externalities = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false , features = ["tuples-96"]} +frame-support = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false, features = ["tuples-96"] } frame-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } frame-system-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } frame-system-rpc-runtime-api = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } @@ -164,10 +164,10 @@ sp-transaction-pool = { git = "https://github.com/paritytech/polkadot-sdk", bran sp-trie = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } sp-version = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -sp-crypto-hashing= { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -sp-crypto-ec-utils= { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -sp-core-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -sp-wasm-interface= { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } +sp-crypto-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } +sp-crypto-ec-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } +sp-core-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } +sp-wasm-interface = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } sc-basic-authorship = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } @@ -287,17 +287,19 @@ pallet-evm-precompile-modexp = { git = "https://github.com/moonbeam-foundation/f pallet-evm-precompile-bn128 = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } pallet-evm-precompile-blake2 = { git = "https://github.com/moonbeam-foundation/frontier", branch = "moonbeam-polkadot-v1.7.2", default-features = false } evm = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +evm-gasometer = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } +evm-runtime = { git = "https://github.com/moonbeam-foundation/evm", branch = "moonbeam-polkadot-v1.7.2", default-features = false } # EVM from acala -module-evm-utility-macro = { path = "runtime/hydradx/src/evm/evm-utility/macro", default-features = false} +module-evm-utility-macro = { path = "runtime/hydradx/src/evm/evm-utility/macro", default-features = false } # Polkadot dependencies pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } -polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false, features = [ - "wasm-api", -]} +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false, features = [ + "wasm-api", +] } polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } @@ -313,7 +315,7 @@ polkadot-node-primitives = { git = "https://github.com/paritytech/polkadot-sdk", polkadot-node-subsystem = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-node-subsystem-util = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-overseer = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" , default-features = false} +polkadot-runtime-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2", default-features = false } polkadot-statement-table = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } rococo-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } westend-runtime = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -325,15 +327,15 @@ cumulus-relay-chain-rpc-interface = { git = "https://github.com/paritytech/polka [patch."https://github.com/moonbeam-foundation/open-runtime-module-library"] # ORML dependencies -orml-benchmarking = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-tokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-traits = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-utilities = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-vesting = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-unknown-tokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-xcm = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-xcm-support = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} -orml-xtokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2"} +orml-benchmarking = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-tokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-traits = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-utilities = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-vesting = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-unknown-tokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-xcm = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-xcm-support = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } +orml-xtokens = { git = "https://github.com/galacticcouncil/open-runtime-module-library", branch = "polkadot-v1.7.2" } [patch."https://github.com/moonbeam-foundation/polkadot-sdk"] frame-benchmarking = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -402,9 +404,9 @@ sc-transaction-pool-api = { git = "https://github.com/paritytech/polkadot-sdk", sc-sysinfo = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } sc-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } sp-state-machine = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} -sp-crypto-hashing= { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} -sp-core-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} +sp-weights = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +sp-crypto-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +sp-core-hashing = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } # Substrate Pallets pallet-aura = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -428,8 +430,8 @@ pallet-treasury = { git = "https://github.com/paritytech/polkadot-sdk", branch = pallet-uniques = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-utility = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } pallet-im-online = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} -pallet-state-trie-migration = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} +pallet-message-queue = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +pallet-state-trie-migration = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } substrate-build-script-utils = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } substrate-frame-rpc-system = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } @@ -461,19 +463,19 @@ cumulus-test-relay-sproof-builder = { git = "https://github.com/paritytech/polka pallet-collator-selection = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } staging-parachain-info = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } xcm-emulator = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} +parachains-common = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } # Polkadot dependencies pallet-xcm = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-cli = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-core-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2"} +polkadot-parachain = { package = "polkadot-parachain-primitives", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-primitives = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-runtime-parachains = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-service = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } xcm = { package = "staging-xcm", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } xcm-builder = { package = "staging-xcm-builder", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } -xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } +xcm-executor = { package = "staging-xcm-executor", git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-node-core-pvf = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } polkadot-node-network-protocol = { git = "https://github.com/paritytech/polkadot-sdk", branch = "release-polkadot-v1.7.2" } diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index 38832f9e6..cb06498d0 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -37,35 +37,36 @@ hydradx-traits = { workspace = true } # Optionals frame-benchmarking = { workspace = true, optional = true } sp-api = { workspace = true, optional = true } +polkadot-xcm = { workspace = true } [dev-dependencies] orml-tokens = { workspace = true } sp-io = { workspace = true } -polkadot-xcm = { workspace = true } test-utils = { workspace = true } pretty_assertions = "1.2.1" +hex-literal = { workspace = true } [features] default = ["std"] runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", ] std = [ - "serde/std", - "codec/std", - "frame-support/std", - "frame-system/std", - "sp-runtime/std", - "sp-core/std", - "sp-std/std", - "hydradx-traits/std", - "sp-api/std", - "frame-benchmarking/std", - "scale-info/std", - "polkadot-xcm/std", - "orml-tokens/std", + "serde/std", + "codec/std", + "frame-support/std", + "frame-system/std", + "sp-runtime/std", + "sp-core/std", + "sp-std/std", + "hydradx-traits/std", + "sp-api/std", + "frame-benchmarking/std", + "scale-info/std", + "polkadot-xcm/std", + "orml-tokens/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 6a9174b64..90165f01d 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -47,10 +47,15 @@ pub use pallet::*; pub use crate::types::{AssetDetails, Balance, Name, Symbol}; use frame_support::storage::with_transaction; use frame_support::BoundedVec; +use hydradx_traits::evm::EvmAddress; use hydradx_traits::{ registry::{Create, Inspect, Mutate}, - AssetKind, + AssetKind, BoundErc20, }; +use orml_traits::GetByKey; +use polkadot_xcm::v3::Junction::AccountKey20; +use polkadot_xcm::v3::Junctions::X1; +use polkadot_xcm::v3::MultiLocation; use sp_runtime::TransactionOutcome; /// Default value of existential deposit. This value is used if existential deposit wasn't @@ -625,8 +630,6 @@ impl Pallet { } } -use orml_traits::GetByKey; - // Return Existential deposit of an asset impl GetByKey for Pallet { fn get(k: &T::AssetId) -> Balance { @@ -758,6 +761,24 @@ impl Create for Pallet { } } +impl BoundErc20 for Pallet +where + T: Config, + T::AssetNativeLocation: Into, +{ + fn contract_address(id: Self::AssetId) -> Option { + if AssetKind::Erc20 == Self::asset_type(id)? { + let location: MultiLocation = Self::asset_to_location(id).unwrap_or_default().into(); + match location.interior { + X1(AccountKey20 { key, .. }) => Some(key.into()), + _ => Some(Default::default()), + } + } else { + None + } + } +} + /// Oracle whitelist based on the asset sufficiency. pub struct OracleWhitelist(PhantomData); impl Contains<(hydradx_traits::Source, ::AssetId, ::AssetId)> diff --git a/pallets/asset-registry/src/tests/evm.rs b/pallets/asset-registry/src/tests/evm.rs new file mode 100644 index 000000000..bc82418be --- /dev/null +++ b/pallets/asset-registry/src/tests/evm.rs @@ -0,0 +1,114 @@ +use super::*; +use frame_support::storage::with_transaction; +use hex_literal::hex; +use polkadot_xcm::v3::Junction::{AccountKey20, Parachain}; +use polkadot_xcm::v3::Junctions::{Here, X1, X2}; +use polkadot_xcm::v3::{Junction, MultiLocation}; +use sp_runtime::{DispatchResult, TransactionOutcome}; + +use mock::Registry; + +fn create_evm_location(address: EvmAddress) -> Option { + Some(AssetLocation(MultiLocation::new( + 0, + X1(AccountKey20 { + key: address.into(), + network: None, + }), + ))) +} + +#[test] +fn ec20_trait_should_return_contract_address() { + ExtBuilder::default().build().execute_with(|| { + let _ = with_transaction(|| { + // Arrange + assert_ok!(>::register_asset( + Some(1), + None, + AssetKind::Erc20, + None, + None, + None, + create_evm_location(hex!["77e1733B3163B4455dBE19aC1B26D72D420EEB54"].into()), + None, + true + )); + + // Act & Assert + assert_eq!( + ::contract_address(1), + Some(hex!["77e1733B3163B4455dBE19aC1B26D72D420EEB54"].into()) + ); + + TransactionOutcome::Commit(DispatchResult::Ok(())) + }); + }); +} + +#[test] +fn return_none_when_asset_is_not_erc20() { + ExtBuilder::default().build().execute_with(|| { + let _ = with_transaction(|| { + // Arrange + assert_ok!(>::register_asset( + Some(1), + None, + AssetKind::Token, + None, + None, + None, + create_evm_location(hex!["77e1733B3163B4455dBE19aC1B26D72D420EEB54"].into()), + None, + true + )); + + // Act & Assert + assert_eq!(::contract_address(1), None); + + TransactionOutcome::Commit(DispatchResult::Ok(())) + }); + }); +} + +#[test] +fn return_zero_when_erc20_has_wrong_location() { + let locations = vec![ + None, + Some(AssetLocation(MultiLocation::new( + 0, + X2( + Parachain(200), + Junction::from(BoundedVec::try_from(1_000.encode()).unwrap()), + ), + ))), + Some(AssetLocation(MultiLocation::new(0, Here))), + ]; + + for location in locations { + ExtBuilder::default().build().execute_with(|| { + let _ = with_transaction(|| { + // Arrange + assert_ok!(>::register_asset( + Some(1), + None, + AssetKind::Erc20, + None, + None, + None, + location.clone(), + None, + true + )); + + // Act & Assert + assert_eq!( + ::contract_address(1), + Some(hex!["0000000000000000000000000000000000000000"].into()) + ); + + TransactionOutcome::Commit(DispatchResult::Ok(())) + }); + }); + } +} diff --git a/pallets/asset-registry/src/tests/mock.rs b/pallets/asset-registry/src/tests/mock.rs index ba04c5707..d88a2f08d 100644 --- a/pallets/asset-registry/src/tests/mock.rs +++ b/pallets/asset-registry/src/tests/mock.rs @@ -27,6 +27,9 @@ use sp_runtime::{ BuildStorage, }; +use codec::{Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; + use frame_support::traits::Everything; use polkadot_xcm::v3::MultiLocation; @@ -90,12 +93,15 @@ impl system::Config for Test { type MaxConsumers = frame_support::traits::ConstU32<16>; } -use codec::{Decode, Encode, MaxEncodedLen}; -use scale_info::TypeInfo; - #[derive(Debug, Default, Encode, Decode, Clone, PartialEq, Eq, TypeInfo, MaxEncodedLen)] pub struct AssetLocation(pub MultiLocation); +impl From for MultiLocation { + fn from(location: AssetLocation) -> Self { + location.0 + } +} + impl pallet_asset_registry::Config for Test { type RuntimeEvent = RuntimeEvent; type Currency = Tokens; diff --git a/pallets/asset-registry/src/tests/mod.rs b/pallets/asset-registry/src/tests/mod.rs index 4e789aee6..37b48612e 100644 --- a/pallets/asset-registry/src/tests/mod.rs +++ b/pallets/asset-registry/src/tests/mod.rs @@ -4,6 +4,7 @@ use crate::*; use frame_support::{assert_noop, assert_ok}; mod create_trait; +mod evm; mod inspect_trait; pub(crate) mod mock; mod mutate_trait; diff --git a/pallets/asset-registry/src/types.rs b/pallets/asset-registry/src/types.rs index 7c819b8a9..cfa4a291d 100644 --- a/pallets/asset-registry/src/types.rs +++ b/pallets/asset-registry/src/types.rs @@ -35,6 +35,7 @@ pub enum AssetType { StableSwap, Bond, External, + Erc20, } impl From for AssetType { @@ -45,6 +46,7 @@ impl From for AssetType { AssetKind::StableSwap => Self::StableSwap, AssetKind::Bond => Self::Bond, AssetKind::External => Self::External, + AssetKind::Erc20 => Self::Erc20, } } } @@ -57,6 +59,7 @@ impl From for AssetKind { AssetType::StableSwap => Self::StableSwap, AssetType::Bond => Self::Bond, AssetType::External => Self::External, + AssetType::Erc20 => Self::Erc20, } } } diff --git a/pallets/currencies/Cargo.toml b/pallets/currencies/Cargo.toml index 0421c8177..8085a04bc 100644 --- a/pallets/currencies/Cargo.toml +++ b/pallets/currencies/Cargo.toml @@ -12,7 +12,10 @@ scale-info = { version = "2.1.2", default-features = false, features = ["derive" serde = { version = "1.0.137", optional = true } codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false } +hydradx-traits = { workspace = true } + sp-runtime = { workspace = true } +sp-core = { workspace = true } sp-io = { workspace = true } sp-std = { workspace = true } frame-support = { workspace = true } @@ -29,17 +32,19 @@ orml-tokens = { workspace = true } [features] default = ["std"] std = [ - "serde", - "codec/std", - "scale-info/std", - "sp-runtime/std", - "sp-std/std", - "sp-io/std", - "frame-support/std", - "frame-system/std", - "pallet-balances/std", - "orml-traits/std", - "orml-tokens/std", - "orml-utilities/std", + "serde", + "codec/std", + "scale-info/std", + "sp-runtime/std", + "sp-core/std", + "sp-std/std", + "sp-io/std", + "hydradx-traits/std", + "frame-support/std", + "frame-system/std", + "pallet-balances/std", + "orml-traits/std", + "orml-tokens/std", + "orml-utilities/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/currencies/src/fungibles.rs b/pallets/currencies/src/fungibles.rs index 66d52952c..f1f454581 100644 --- a/pallets/currencies/src/fungibles.rs +++ b/pallets/currencies/src/fungibles.rs @@ -1,8 +1,10 @@ use crate::module::{BalanceOf, CurrencyIdOf}; -use crate::{Config, Pallet}; +use crate::{Config, Error, Pallet}; +use frame_support::fail; use frame_support::traits::tokens::{ fungible, fungibles, DepositConsequence, Fortitude, Precision, Preservation, Provenance, WithdrawConsequence, }; +use hydradx_traits::BoundErc20; use orml_traits::MultiCurrency; use sp_runtime::traits::Get; use sp_runtime::DispatchError; @@ -41,7 +43,10 @@ where if asset == T::GetNativeCurrencyId::get() { >::balance(who).into() } else { - >::balance(asset.into(), who).into() + match T::BoundErc20::contract_address(asset) { + Some(contract) => T::Erc20Currency::free_balance(contract, who), + None => >::balance(asset.into(), who).into(), + } } } @@ -54,13 +59,16 @@ where if asset == T::GetNativeCurrencyId::get() { >::reducible_balance(who, preservation, force).into() } else { - >::reducible_balance( - asset.into(), - who, - preservation, - force, - ) - .into() + match T::BoundErc20::contract_address(asset) { + Some(contract) => T::Erc20Currency::free_balance(contract, who), + None => >::reducible_balance( + asset.into(), + who, + preservation, + force, + ) + .into(), + } } } @@ -73,12 +81,15 @@ where if asset == T::GetNativeCurrencyId::get() { >::can_deposit(who, amount.into(), provenance) } else { - >::can_deposit( - asset.into(), - who, - amount.into(), - provenance, - ) + match T::BoundErc20::contract_address(asset) { + Some(_) => DepositConsequence::UnknownAsset, + None => >::can_deposit( + asset.into(), + who, + amount.into(), + provenance, + ), + } } } @@ -90,8 +101,15 @@ where if asset == T::GetNativeCurrencyId::get() { >::can_withdraw(who, amount.into()).into() } else { - >::can_withdraw(asset.into(), who, amount.into()) - .into() + match T::BoundErc20::contract_address(asset) { + Some(_) => WithdrawConsequence::UnknownAsset, + None => >::can_withdraw( + asset.into(), + who, + amount.into(), + ) + .into(), + } } } @@ -99,7 +117,10 @@ where if asset == T::GetNativeCurrencyId::get() { true } else { - >::asset_exists(asset.into()) + match T::BoundErc20::contract_address(asset) { + Some(_) => true, + None => >::asset_exists(asset.into()), + } } } } @@ -123,10 +144,13 @@ where if asset == T::GetNativeCurrencyId::get() { >::handle_dust(fungible::Dust(dust.1.into())) } else { - >::handle_dust(fungibles::Dust( - dust.0.into(), - dust.1.into(), - )) + match T::BoundErc20::contract_address(asset) { + Some(_) => {} + None => >::handle_dust(fungibles::Dust( + dust.0.into(), + dust.1.into(), + )), + } } } @@ -139,19 +163,24 @@ where let result = >::write_balance(who, amount.into())?; Ok(result.map(|balance| balance.into())) } else { - let result = >::write_balance( - asset.into(), - who, - amount.into(), - )?; - Ok(result.map(|balance| balance.into())) + match T::BoundErc20::contract_address(asset) { + Some(_) => fail!(Error::::NotSupported), + None => { + let result = >::write_balance( + asset.into(), + who, + amount.into(), + )?; + Ok(result.map(|balance| balance.into())) + } + } } } fn set_total_issuance(asset: Self::AssetId, amount: Self::Balance) { if asset == T::GetNativeCurrencyId::get() { >::set_total_issuance(amount.into()) - } else { + } else if T::BoundErc20::contract_address(asset).is_none() { >::set_total_issuance(asset.into(), amount.into()) } } @@ -159,7 +188,7 @@ where fn deactivate(asset: Self::AssetId, amount: Self::Balance) { if asset == T::GetNativeCurrencyId::get() { >::deactivate(amount.into()) - } else { + } else if T::BoundErc20::contract_address(asset).is_none() { >::deactivate(asset.into(), amount.into()) } } @@ -167,7 +196,7 @@ where fn reactivate(asset: Self::AssetId, amount: Self::Balance) { if asset == T::GetNativeCurrencyId::get() { >::reactivate(amount.into()) - } else { + } else if T::BoundErc20::contract_address(asset).is_none() { >::reactivate(asset.into(), amount.into()) } } @@ -197,7 +226,13 @@ where if asset == T::GetNativeCurrencyId::get() { >::mint_into(who, amount.into()).into() } else { - >::mint_into(asset.into(), who, amount.into()).into() + match T::BoundErc20::contract_address(asset) { + Some(_) => fail!(Error::::NotSupported), + None => { + >::mint_into(asset.into(), who, amount.into()) + .into() + } + } } } @@ -212,14 +247,17 @@ where >::burn_from(who, amount.into(), precision, force) .into() } else { - >::burn_from( - asset.into(), - who, - amount.into(), - precision, - force, - ) - .into() + match T::BoundErc20::contract_address(asset) { + Some(_) => fail!(Error::::NotSupported), + None => >::burn_from( + asset.into(), + who, + amount.into(), + precision, + force, + ) + .into(), + } } } @@ -234,14 +272,17 @@ where >::transfer(source, dest, amount.into(), preservation) .into() } else { - >::transfer( - asset.into(), - source, - dest, - amount.into(), - preservation, - ) - .into() + match T::BoundErc20::contract_address(asset) { + Some(contract) => T::Erc20Currency::transfer(contract, source, dest, amount).map(|_| amount), + None => >::transfer( + asset.into(), + source, + dest, + amount.into(), + preservation, + ) + .into(), + } } } } diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index f280e66f2..31ac7fd1e 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -41,6 +41,7 @@ use codec::Codec; use frame_support::{ + fail, pallet_prelude::*, traits::{ Currency as PalletCurrency, ExistenceRequirement, Get, Imbalance, LockableCurrency as PalletLockableCurrency, @@ -49,6 +50,8 @@ use frame_support::{ }, }; use frame_system::{ensure_root, ensure_signed, pallet_prelude::*}; +use hydradx_traits::evm::EvmAddress; +use hydradx_traits::BoundErc20; use orml_traits::{ arithmetic::{Signed, SimpleArithmetic}, currency::TransferAll, @@ -101,6 +104,10 @@ pub mod module { + BasicReservableCurrency> + NamedBasicReservableCurrency, Balance = BalanceOf>; + type Erc20Currency: MultiCurrency>; + + type BoundErc20: BoundErc20>; + #[pallet::constant] type GetNativeCurrencyId: Get>; @@ -116,6 +123,8 @@ pub mod module { BalanceTooLow, /// Deposit result is not expected DepositFailed, + /// Operation is not supported for this currency + NotSupported, } #[pallet::event] @@ -225,7 +234,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::minimum_balance() } else { - T::MultiCurrency::minimum_balance(currency_id) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::minimum_balance(contract), + None => T::MultiCurrency::minimum_balance(currency_id), + } } } @@ -233,7 +245,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::total_issuance() } else { - T::MultiCurrency::total_issuance(currency_id) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::total_issuance(contract), + None => T::MultiCurrency::total_issuance(currency_id), + } } } @@ -241,7 +256,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::total_balance(who) } else { - T::MultiCurrency::total_balance(currency_id, who) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::total_balance(contract, who), + None => T::MultiCurrency::total_balance(currency_id, who), + } } } @@ -249,7 +267,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::free_balance(who) } else { - T::MultiCurrency::free_balance(currency_id, who) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::free_balance(contract, who), + None => T::MultiCurrency::free_balance(currency_id, who), + } } } @@ -257,7 +278,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::ensure_can_withdraw(who, amount) } else { - T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::ensure_can_withdraw(contract, who, amount), + None => T::MultiCurrency::ensure_can_withdraw(currency_id, who, amount), + } } } @@ -273,7 +297,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::transfer(from, to, amount)?; } else { - T::MultiCurrency::transfer(currency_id, from, to, amount)?; + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::transfer(contract, from, to, amount)?, + None => T::MultiCurrency::transfer(currency_id, from, to, amount)?, + }; } Self::deposit_event(Event::Transferred { currency_id, @@ -291,7 +318,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::deposit(who, amount)?; } else { - T::MultiCurrency::deposit(currency_id, who, amount)?; + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::deposit(contract, who, amount)?, + None => T::MultiCurrency::deposit(currency_id, who, amount)?, + } } Self::deposit_event(Event::Deposited { currency_id, @@ -308,7 +338,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::withdraw(who, amount)?; } else { - T::MultiCurrency::withdraw(currency_id, who, amount)?; + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::withdraw(contract, who, amount)?, + None => T::MultiCurrency::withdraw(currency_id, who, amount)?, + } } Self::deposit_event(Event::Withdrawn { currency_id, @@ -322,7 +355,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::can_slash(who, amount) } else { - T::MultiCurrency::can_slash(currency_id, who, amount) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::can_slash(contract, who, amount), + None => T::MultiCurrency::can_slash(currency_id, who, amount), + } } } @@ -330,7 +366,10 @@ impl MultiCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::slash(who, amount) } else { - T::MultiCurrency::slash(currency_id, who, amount) + match T::BoundErc20::contract_address(currency_id) { + Some(contract) => T::Erc20Currency::slash(contract, who, amount), + None => T::MultiCurrency::slash(currency_id, who, amount), + } } } } @@ -342,7 +381,10 @@ impl MultiCurrencyExtended for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::update_balance(who, by_amount)?; } else { - T::MultiCurrency::update_balance(currency_id, who, by_amount)?; + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::update_balance(currency_id, who, by_amount)?, + } } Self::deposit_event(Event::BalanceUpdated { currency_id, @@ -365,7 +407,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::set_lock(lock_id, who, amount) } else { - T::MultiCurrency::set_lock(lock_id, currency_id, who, amount) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::set_lock(lock_id, currency_id, who, amount), + } } } @@ -378,7 +423,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::extend_lock(lock_id, who, amount) } else { - T::MultiCurrency::extend_lock(lock_id, currency_id, who, amount) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::extend_lock(lock_id, currency_id, who, amount), + } } } @@ -386,7 +434,10 @@ impl MultiLockableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::remove_lock(lock_id, who) } else { - T::MultiCurrency::remove_lock(lock_id, currency_id, who) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::remove_lock(lock_id, currency_id, who), + } } } } @@ -396,7 +447,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::can_reserve(who, value) } else { - T::MultiCurrency::can_reserve(currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => false, + None => T::MultiCurrency::can_reserve(currency_id, who, value), + } } } @@ -404,7 +458,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::slash_reserved(who, value) } else { - T::MultiCurrency::slash_reserved(currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => Default::default(), + None => T::MultiCurrency::slash_reserved(currency_id, who, value), + } } } @@ -412,7 +469,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserved_balance(who) } else { - T::MultiCurrency::reserved_balance(currency_id, who) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => Default::default(), + None => T::MultiCurrency::reserved_balance(currency_id, who), + } } } @@ -420,7 +480,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserve(who, value) } else { - T::MultiCurrency::reserve(currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::reserve(currency_id, who, value), + } } } @@ -428,7 +491,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::unreserve(who, value) } else { - T::MultiCurrency::unreserve(currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => value, + None => T::MultiCurrency::unreserve(currency_id, who, value), + } } } @@ -442,7 +508,10 @@ impl MultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::repatriate_reserved(slashed, beneficiary, value, status) } else { - T::MultiCurrency::repatriate_reserved(currency_id, slashed, beneficiary, value, status) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::repatriate_reserved(currency_id, slashed, beneficiary, value, status), + } } } } @@ -459,7 +528,10 @@ impl NamedMultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::slash_reserved_named(id, who, value) } else { - T::MultiCurrency::slash_reserved_named(id, currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => Default::default(), + None => T::MultiCurrency::slash_reserved_named(id, currency_id, who, value), + } } } @@ -471,7 +543,10 @@ impl NamedMultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserved_balance_named(id, who) } else { - T::MultiCurrency::reserved_balance_named(id, currency_id, who) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => Default::default(), + None => T::MultiCurrency::reserved_balance_named(id, currency_id, who), + } } } @@ -484,7 +559,10 @@ impl NamedMultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::reserve_named(id, who, value) } else { - T::MultiCurrency::reserve_named(id, currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => T::MultiCurrency::reserve_named(id, currency_id, who, value), + } } } @@ -497,7 +575,10 @@ impl NamedMultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::unreserve_named(id, who, value) } else { - T::MultiCurrency::unreserve_named(id, currency_id, who, value) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => value, + None => T::MultiCurrency::unreserve_named(id, currency_id, who, value), + } } } @@ -512,7 +593,12 @@ impl NamedMultiReservableCurrency for Pallet { if currency_id == T::GetNativeCurrencyId::get() { T::NativeCurrency::repatriate_reserved_named(id, slashed, beneficiary, value, status) } else { - T::MultiCurrency::repatriate_reserved_named(id, currency_id, slashed, beneficiary, value, status) + match T::BoundErc20::contract_address(currency_id) { + Some(_) => fail!(Error::::NotSupported), + None => { + T::MultiCurrency::repatriate_reserved_named(id, currency_id, slashed, beneficiary, value, status) + } + } } } } diff --git a/pallets/currencies/src/mock.rs b/pallets/currencies/src/mock.rs index 701e1d67c..e7f299dff 100644 --- a/pallets/currencies/src/mock.rs +++ b/pallets/currencies/src/mock.rs @@ -3,11 +3,14 @@ #![cfg(test)] use super::*; +use crate as currencies; use frame_support::{ construct_runtime, parameter_types, traits::{ConstU32, ConstU64, Everything, Nothing}, PalletId, }; +use hydradx_traits::evm::EvmAddress; +use hydradx_traits::AssetKind; use orml_traits::parameter_type_with_key; use sp_core::H256; use sp_runtime::{ @@ -15,8 +18,6 @@ use sp_runtime::{ AccountId32, BuildStorage, }; -use crate as currencies; - pub type AccountId = AccountId32; impl frame_system::Config for Runtime { type RuntimeOrigin = RuntimeOrigin; @@ -102,12 +103,116 @@ impl Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = AdaptedBasicCurrency; + type Erc20Currency = Erc20Currency; + type BoundErc20 = Runtime; type GetNativeCurrencyId = GetNativeCurrencyId; type WeightInfo = (); } pub type NativeCurrency = NativeCurrencyOf; pub type AdaptedBasicCurrency = BasicCurrencyAdapter; +pub struct Erc20Currency(PhantomData); + +impl MultiCurrency for Erc20Currency +where + T::AccountId: AsRef<[u8; 32]> + IsType, +{ + type CurrencyId = EvmAddress; + type Balance = Balance; + + fn minimum_balance(_currency_id: Self::CurrencyId) -> Self::Balance { + todo!() + } + + fn total_issuance(_currency_id: Self::CurrencyId) -> Self::Balance { + todo!() + } + + fn total_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { + todo!() + } + + fn free_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { + todo!() + } + + fn ensure_can_withdraw( + _currency_id: Self::CurrencyId, + _who: &T::AccountId, + _amount: Self::Balance, + ) -> DispatchResult { + todo!() + } + + fn transfer( + _currency_id: Self::CurrencyId, + _from: &T::AccountId, + _to: &T::AccountId, + _amount: Self::Balance, + ) -> DispatchResult { + todo!() + } + + fn deposit(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { + todo!() + } + + fn withdraw(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { + todo!() + } + + fn can_slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _value: Self::Balance) -> bool { + todo!() + } + + fn slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> Self::Balance { + todo!() + } +} + +impl hydradx_traits::Inspect for Runtime { + type AssetId = CurrencyId; + type Location = (); + + fn is_sufficient(_id: Self::AssetId) -> bool { + todo!() + } + + fn exists(_id: Self::AssetId) -> bool { + todo!() + } + + fn decimals(_id: Self::AssetId) -> Option { + todo!() + } + + fn asset_type(_id: Self::AssetId) -> Option { + todo!() + } + + fn is_banned(_id: Self::AssetId) -> bool { + todo!() + } + + fn asset_name(_id: Self::AssetId) -> Option> { + todo!() + } + + fn asset_symbol(_id: Self::AssetId) -> Option> { + todo!() + } + + fn existential_deposit(_id: Self::AssetId) -> Option { + todo!() + } +} + +impl BoundErc20 for Runtime { + fn contract_address(_id: Self::AssetId) -> Option { + None + } +} + type Block = frame_system::mocking::MockBlock; construct_runtime!( diff --git a/pallets/evm-accounts/src/benchmarking.rs b/pallets/evm-accounts/src/benchmarking.rs index 9214eab69..bf0fa4943 100644 --- a/pallets/evm-accounts/src/benchmarking.rs +++ b/pallets/evm-accounts/src/benchmarking.rs @@ -74,5 +74,28 @@ benchmarks! { assert!(!ContractDeployer::::contains_key(evm_address)); } + approve_contract { + let contract: T::AccountId = account("contract", 0, 1); + let evm_address = Pallet::::evm_address(&contract); + assert!(!ApprovedContract::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(ApprovedContract::::contains_key(evm_address)); + } + + disapprove_contract { + let contract: T::AccountId = account("contract", 0, 1); + let evm_address = Pallet::::evm_address(&contract); + + EVMAccounts::::approve_contract(RawOrigin::Root.into(), evm_address)?; + + assert!(ApprovedContract::::contains_key(evm_address)); + + }: _(RawOrigin::Root, evm_address) + verify { + assert!(!ApprovedContract::::contains_key(evm_address)); + } + impl_benchmark_test_suite!(Pallet, crate::mock::ExtBuilder::default().build(), crate::mock::Test); } diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs index e380c4436..efae74a0f 100644 --- a/pallets/evm-accounts/src/lib.rs +++ b/pallets/evm-accounts/src/lib.rs @@ -41,12 +41,18 @@ //! `ControllerOrigin` can add this permission to EVM addresses. //! The list of whitelisted accounts is stored in the storage of this pallet. //! +//! ### Approving smart contracts +//! This pallet is also used to control which contracts are allowed to manage balances and tokens. +//! `ApprovedContract` storage is used by the currencies precompile to determine whenever contract is allowed to transfer or not. +//! //! ### Dispatchable Functions //! //! * `bind_evm_address` - Binds a Substrate address to EVM address. //! * `add_contract_deployer` - Adds a permission to deploy smart contracts. //! * `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart contracts. //! * `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. +//! * `approve_contract` - Approves contract address to manage balances. +//! * `disapprove_contract` - Disapproves contract address to manage balances. #![cfg_attr(not(feature = "std"), no_std)] @@ -114,6 +120,10 @@ pub mod pallet { #[pallet::storage] pub(super) type ContractDeployer = StorageMap<_, Blake2_128Concat, EvmAddress, ()>; + /// Whitelisted contracts that are allowed to manage balances and tokens. + #[pallet::storage] + pub(super) type ApprovedContract = StorageMap<_, Blake2_128Concat, EvmAddress, ()>; + #[pallet::event] #[pallet::generate_deposit(pub(crate) fn deposit_event)] pub enum Event { @@ -123,6 +133,10 @@ pub mod pallet { DeployerAdded { who: EvmAddress }, /// Deployer was removed. DeployerRemoved { who: EvmAddress }, + /// Contract was approved. + ContractApproved { address: EvmAddress }, + /// Contract was disapproved. + ContractDisapproved { address: EvmAddress }, } #[pallet::error] @@ -260,10 +274,44 @@ pub mod pallet { Ok(()) } + + /// Adds address of the contract to the list of approved contracts to manage balances. + /// + /// Effectively giving it allowance to for any balances and tokens. + /// + /// Parameters: + /// - `origin`: Must be `ControllerOrigin`. + /// - `address`: Contract address that will be approved + /// + /// Emits `ContractApproved` event when successful. + #[pallet::call_index(4)] + #[pallet::weight(::WeightInfo::approve_contract())] + pub fn approve_contract(origin: OriginFor, address: EvmAddress) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + >::insert(address, ()); + Self::deposit_event(Event::ContractApproved { address }); + Ok(()) + } + + /// Removes address of the contract from the list of approved contracts to manage balances. + /// + /// Parameters: + /// - `origin`: Must be `ControllerOrigin`. + /// - `address`: Contract address that will be disapproved + /// + /// Emits `ContractDisapproved` event when successful. + #[pallet::call_index(5)] + #[pallet::weight(::WeightInfo::disapprove_contract())] + pub fn disapprove_contract(origin: OriginFor, address: EvmAddress) -> DispatchResult { + T::ControllerOrigin::ensure_origin(origin.clone())?; + >::remove(address); + Self::deposit_event(Event::ContractDisapproved { address }); + Ok(()) + } } } -impl InspectEvmAccounts for Pallet +impl InspectEvmAccounts for Pallet where T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, { @@ -308,4 +356,9 @@ where fn can_deploy_contracts(evm_address: EvmAddress) -> bool { ContractDeployer::::contains_key(evm_address) } + + /// Returns `True` if the address is allowed to manage balances and tokens. + fn is_approved_contract(evm_address: EvmAddress) -> bool { + ApprovedContract::::contains_key(evm_address) + } } diff --git a/pallets/evm-accounts/src/weights.rs b/pallets/evm-accounts/src/weights.rs index d9175d81c..03a31b0ce 100644 --- a/pallets/evm-accounts/src/weights.rs +++ b/pallets/evm-accounts/src/weights.rs @@ -57,6 +57,8 @@ pub trait WeightInfo { fn add_contract_deployer() -> Weight; fn remove_contract_deployer() -> Weight; fn renounce_contract_deployer() -> Weight; + fn approve_contract() -> Weight; + fn disapprove_contract() -> Weight; } /// Weights for `pallet_evm_accounts` using the HydraDX node and recommended hardware. @@ -109,4 +111,22 @@ impl WeightInfo for () { // Minimum execution time: 9_421_000 picoseconds. Weight::from_parts(9_685_000, 0).saturating_add(RocksDbWeight::get().writes(1_u64)) } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + fn approve_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_157_000 picoseconds. + Weight::from_parts(13_481_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } + /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) + /// Proof: `EVMAccounts::ContractDeployer` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) + fn disapprove_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 13_196_000 picoseconds. + Weight::from_parts(13_517_000, 0).saturating_add(RocksDbWeight::get().writes(1)) + } } diff --git a/pallets/transaction-multi-payment/src/lib.rs b/pallets/transaction-multi-payment/src/lib.rs index ac2d0ca2f..368bb325c 100644 --- a/pallets/transaction-multi-payment/src/lib.rs +++ b/pallets/transaction-multi-payment/src/lib.rs @@ -138,7 +138,7 @@ pub mod pallet { type EvmAssetId: Get>; /// EVM Accounts info - type InspectEvmAccounts: InspectEvmAccounts; + type InspectEvmAccounts: InspectEvmAccounts; type EvmPermit: EVMPermit; diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9fe493c72..524bc8d27 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -26,6 +26,7 @@ use frame_support::sp_runtime::{ traits::{BlakeTwo256, IdentifyAccount, Verify}, MultiSignature, }; +use sp_core::H160; pub mod constants; @@ -60,6 +61,8 @@ pub type Signature = MultiSignature; /// to the public key of our transaction signing scheme. pub type AccountId = <::Signer as IdentifyAccount>::AccountId; +pub type EvmAddress = H160; + /// The type for looking up accounts. We don't expect more than 4 billion of them, but you /// never know... pub type AccountIndex = u32; diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 1aa98f746..48efcbbca 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -16,6 +16,7 @@ // limitations under the License. use super::*; +use crate::evm::Erc20Currency; use crate::system::NativeAssetId; use hydradx_adapters::{ @@ -335,6 +336,8 @@ impl pallet_currencies::Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = Erc20Currency; + type BoundErc20 = AssetRegistry; type GetNativeCurrencyId = NativeAssetId; type WeightInfo = weights::pallet_currencies::HydraWeight; } diff --git a/runtime/hydradx/src/evm/erc20_currency.rs b/runtime/hydradx/src/evm/erc20_currency.rs new file mode 100644 index 000000000..03fe8e245 --- /dev/null +++ b/runtime/hydradx/src/evm/erc20_currency.rs @@ -0,0 +1,272 @@ +use crate::evm::executor::{CallResult, Executor}; +use crate::evm::{EvmAccounts, EvmAddress}; +use ethabi::ethereum_types::BigEndianHash; +use evm::ExitReason::Succeed; +use evm::ExitSucceed::Returned; +use evm::{ExitReason, ExitSucceed}; +use frame_support::{dispatch::DispatchResult, fail, pallet_prelude::*}; +use hydradx_traits::evm::{CallContext, InspectEvmAccounts, ERC20, EVM}; +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use orml_traits::MultiCurrency; +use pallet_currencies::{Config, Error}; +use primitives::Balance; +use sp_core::crypto::AccountId32; +use sp_core::{H160, H256, U256}; +use sp_runtime::traits::{CheckedConversion, Zero}; +use sp_runtime::{DispatchError, SaturatedConversion}; +use sp_std::vec::Vec; + +#[module_evm_utility_macro::generate_function_selector] +#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] +#[repr(u32)] +pub enum Function { + Name = "name()", + Symbol = "symbol()", + Decimals = "decimals()", + TotalSupply = "totalSupply()", + BalanceOf = "balanceOf(address)", + Allowance = "allowance(address,address)", + Transfer = "transfer(address,uint256)", + Approve = "approve(address,uint256)", + TransferFrom = "transferFrom(address,address,uint256)", +} +type BalanceOf = <::Currency as frame_support::traits::Currency< + ::AccountId, +>>::Balance; + +pub struct Erc20Currency(sp_std::marker::PhantomData); + +impl ERC20 for Erc20Currency +where + T: pallet_evm::Config, + BalanceOf: TryFrom + Into, +{ + type Balance = Balance; + + fn name(context: CallContext) -> Option> { + let data = Into::::into(Function::Name).to_be_bytes().to_vec(); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_string(value.as_slice().to_vec()), + _ => None, + } + } + + fn symbol(context: CallContext) -> Option> { + let data = Into::::into(Function::Symbol).to_be_bytes().to_vec(); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_string(value.as_slice().to_vec()), + _ => None, + } + } + + fn decimals(context: CallContext) -> Option { + let data = Into::::into(Function::Decimals).to_be_bytes().to_vec(); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_integer(value)?.checked_into(), + _ => None, + } + } + + fn total_supply(context: CallContext) -> Balance { + let data = Into::::into(Function::TotalSupply).to_be_bytes().to_vec(); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_integer(value).unwrap_or_default().saturated_into(), + _ => Default::default(), + } + } + + fn balance_of(context: CallContext, address: EvmAddress) -> Balance { + let mut data = Into::::into(Function::BalanceOf).to_be_bytes().to_vec(); + // address + data.extend_from_slice(H256::from(address).as_bytes()); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_integer(value).unwrap_or_default().saturated_into(), + _ => Default::default(), + } + } + + fn allowance(context: CallContext, owner: EvmAddress, spender: EvmAddress) -> Balance { + let mut data = Into::::into(Function::Allowance).to_be_bytes().to_vec(); + // owner + data.extend_from_slice(H256::from(owner).as_bytes()); + // spender + data.extend_from_slice(H256::from(spender).as_bytes()); + + let (exit_reason, value) = Executor::::view(context, data, 100_000); + match exit_reason { + Succeed(Returned) => decode_integer(value).unwrap_or_default().saturated_into(), + _ => Default::default(), + } + } + + fn approve(context: CallContext, spender: EvmAddress, value: Balance) -> DispatchResult { + let mut data = Into::::into(Function::Approve).to_be_bytes().to_vec(); + // spender + data.extend_from_slice(H256::from(spender).as_bytes()); + // amount + data.extend_from_slice(H256::from_uint(&U256::from(value.saturated_into::())).as_bytes()); + + handle_result(Executor::::call(context, data, U256::zero(), 200_000)) + } + + // Calls the transfer method on an ERC20 contract using the given context. + fn transfer(context: CallContext, to: H160, value: Balance) -> DispatchResult { + let mut data = Into::::into(Function::Transfer).to_be_bytes().to_vec(); + // to + data.extend_from_slice(H256::from(to).as_bytes()); + // amount + data.extend_from_slice(H256::from_uint(&U256::from(value.saturated_into::())).as_bytes()); + + handle_result(Executor::::call(context, data, U256::zero(), 200_000)) + } + + fn transfer_from(context: CallContext, from: EvmAddress, to: EvmAddress, value: Balance) -> DispatchResult { + let mut data = Into::::into(Function::TransferFrom).to_be_bytes().to_vec(); + // from + data.extend_from_slice(H256::from(from).as_bytes()); + // to + data.extend_from_slice(H256::from(to).as_bytes()); + // amount + data.extend_from_slice(H256::from_uint(&U256::from(value.saturated_into::())).as_bytes()); + + handle_result(Executor::::call(context, data, U256::zero(), 200_000)) + } +} + +fn decode_string(output: Vec) -> Option> { + // output is 32-byte aligned and consists of 3 parts: + // - part 1: 32 byte, the offset of its description is passed in the position of + // the corresponding parameter or return value. + // - part 2: 32 byte, string length + // - part 3: string data + if output.len() < 64 || output.len() % 32 != 0 { + return None; + } + + let offset = U256::from_big_endian(&output[0..32]); + let length = U256::from_big_endian(&output[offset.as_usize()..offset.as_usize() + 32]); + if output.len() < offset.as_usize() + 32 + length.as_usize() { + return None; + } + + let mut data = Vec::new(); + data.extend_from_slice(&output[offset.as_usize() + 32..offset.as_usize() + 32 + length.as_usize()]); + + Some(data.to_vec()) +} + +fn decode_integer(value: Vec) -> Option { + if value.len() != 32 { + return None; + } + U256::checked_from(value.as_slice()) +} + +fn decode_bool(value: Vec) -> bool { + let mut bytes = [0u8; 32]; + U256::from(1).to_big_endian(&mut bytes); + value == bytes +} + +fn handle_result(result: CallResult) -> DispatchResult { + let (exit_reason, value) = result; + if decode_bool(value) != true { + return Err(DispatchError::Other("erc20 invalid return value")); + } + match exit_reason { + ExitReason::Succeed(ExitSucceed::Returned) => Ok(()), + ExitReason::Succeed(ExitSucceed::Stopped) => Ok(()), + _ => Err(DispatchError::Other("erc20 call failed")), + } +} + +impl MultiCurrency for Erc20Currency +where + T: Config + pallet_evm::Config, + pallet_evm_accounts::Pallet: InspectEvmAccounts, + T::AccountId: AsRef<[u8; 32]> + IsType, + BalanceOf: TryFrom + Into, +{ + type CurrencyId = EvmAddress; + type Balance = Balance; + + fn minimum_balance(_contract: Self::CurrencyId) -> Self::Balance { + Zero::zero() + } + + fn total_issuance(contract: Self::CurrencyId) -> Self::Balance { + ::total_supply(CallContext { + contract, + sender: Default::default(), + origin: Default::default(), + }) + } + + fn total_balance(contract: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + Self::free_balance(contract, who) + } + + fn free_balance(contract: Self::CurrencyId, who: &T::AccountId) -> Self::Balance { + ::balance_of(CallContext::new_view(contract), EvmAccounts::::evm_address(who)) + } + + fn ensure_can_withdraw( + contract: Self::CurrencyId, + who: &T::AccountId, + amount: Self::Balance, + ) -> sp_runtime::DispatchResult { + if amount.is_zero() { + return Ok(()); + } + ensure!(Self::free_balance(contract, who) >= amount, Error::::BalanceTooLow); + Ok(()) + } + + fn transfer( + contract: Self::CurrencyId, + from: &T::AccountId, + to: &T::AccountId, + amount: Self::Balance, + ) -> sp_runtime::DispatchResult { + let sender = >::evm_address(from); + ::transfer( + CallContext { + contract, + sender, + origin: sender, + }, + EvmAccounts::::evm_address(to), + amount, + ) + } + + fn deposit(_contract: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> sp_runtime::DispatchResult { + fail!(Error::::NotSupported) + } + + fn withdraw( + _contract: Self::CurrencyId, + _who: &T::AccountId, + _amount: Self::Balance, + ) -> sp_runtime::DispatchResult { + fail!(Error::::NotSupported) + } + + fn can_slash(_contract: Self::CurrencyId, _who: &T::AccountId, value: Self::Balance) -> bool { + value.is_zero() + } + + fn slash(_contract: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> Self::Balance { + Default::default() + } +} diff --git a/runtime/hydradx/src/evm/evm-utility/Cargo.toml b/runtime/hydradx/src/evm/evm-utility/Cargo.toml index f6182015f..b897dc7a5 100644 --- a/runtime/hydradx/src/evm/evm-utility/Cargo.toml +++ b/runtime/hydradx/src/evm/evm-utility/Cargo.toml @@ -11,24 +11,24 @@ sha3 = { version = "0.10.6", default-features = false } sp-std = { workspace = true } #Evm dependencies -evm = { git = "https://github.com/rust-blockchain/evm", rev = "13240a8a551586fdef0b5028ed73af80b248092a", default-features = false, features = ["with-codec"] } -evm-gasometer = { git = "https://github.com/rust-blockchain/evm", rev = "13240a8a551586fdef0b5028ed73af80b248092a", default-features = false } -evm-runtime = { git = "https://github.com/rust-blockchain/evm", rev = "13240a8a551586fdef0b5028ed73af80b248092a", default-features = false } -ethereum = { version = "0.14.0", default-features = false, features = ["with-codec"] } +evm = { workspace = true, features = ["with-codec"] } +evm-gasometer = { workspace = true } +evm-runtime = { workspace = true } +ethereum = { version = "0.15.0", default-features = false, features = ["with-codec"] } [features] default = ["std"] std = [ - "sha3/std", - "sp-std/std", - "evm/std", - "evm/with-serde", - "evm-runtime/std", - "evm-gasometer/std", - "ethereum/with-serde", + "sha3/std", + "sp-std/std", + "evm/std", + "evm/with-serde", + "evm-runtime/std", + "evm-gasometer/std", + "ethereum/with-serde", ] tracing = [ - "evm/tracing", - "evm-gasometer/tracing", - "evm-runtime/tracing", + "evm/tracing", + "evm-gasometer/tracing", + "evm-runtime/tracing", ] diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs new file mode 100644 index 000000000..37a978c9e --- /dev/null +++ b/runtime/hydradx/src/evm/executor.rs @@ -0,0 +1,69 @@ +use evm::executor::stack::{StackExecutor, StackSubstateMetadata}; +use evm::ExitFatal::Other; +use evm::ExitReason; +use fp_evm::Vicinity; +use frame_support::storage::with_transaction; +use frame_support::traits::Get; +use hydradx_traits::evm::{CallContext, EVM}; +use pallet_evm::runner::stack::SubstrateStackState; +use pallet_evm::Config; +use primitive_types::{H160, U256}; +use sp_runtime::{DispatchError, TransactionOutcome}; + +pub struct Executor(sp_std::marker::PhantomData); + +pub type CallResult = (ExitReason, Vec); + +type BalanceOf = <::Currency as frame_support::traits::Currency< + ::AccountId, +>>::Balance; + +impl Executor +where + T: Config + frame_system::Config, + BalanceOf: TryFrom + Into, +{ + pub fn execute<'config, F>(origin: H160, gas: u64, f: F) -> CallResult + where + F: for<'precompiles> FnOnce( + &mut StackExecutor<'config, 'precompiles, SubstrateStackState<'_, 'config, T>, T::PrecompilesType>, + ) -> (ExitReason, Vec), + { + let gas_price = U256::one(); + let vicinity = Vicinity { + gas_price, + origin, + ..Default::default() + }; + + let config = ::config(); + let precompiles = T::PrecompilesValue::get(); + let metadata = StackSubstateMetadata::new(gas, config); + let state = SubstrateStackState::new(&vicinity, metadata, None, None); + let mut executor = StackExecutor::new_with_precompiles(state, config, &precompiles); + + f(&mut executor) + } +} + +impl EVM for Executor +where + T: Config + frame_system::Config, + BalanceOf: TryFrom + Into, +{ + fn call(context: CallContext, data: Vec, value: U256, gas: u64) -> CallResult { + Self::execute(context.origin, gas, |executor| { + executor.transact_call(context.sender, context.contract, value, data, gas, vec![]) + }) + } + + fn view(context: CallContext, data: Vec, gas: u64) -> CallResult { + with_transaction(|| { + let result = Self::execute(context.origin, gas, |executor| { + executor.transact_call(context.sender, context.contract, U256::zero(), data, gas, vec![]) + }); + TransactionOutcome::Rollback(Ok::(result)) + }) + .unwrap_or((ExitReason::Fatal(Other("TransactionalError".into())), Vec::new())) + } +} diff --git a/runtime/hydradx/src/evm/mod.rs b/runtime/hydradx/src/evm/mod.rs index 04c15eab1..009597a68 100644 --- a/runtime/hydradx/src/evm/mod.rs +++ b/runtime/hydradx/src/evm/mod.rs @@ -46,11 +46,17 @@ use primitives::{constants::chain::MAXIMUM_BLOCK_WEIGHT, AssetId}; use sp_core::{Get, U256}; mod accounts_conversion; +mod erc20_currency; mod evm_fee; +mod executor; pub mod permit; pub mod precompiles; mod runner; +pub use erc20_currency::Erc20Currency; +pub use erc20_currency::Function; +pub use executor::Executor; + // Current approximation of the gas per second consumption considering // EVM execution over compiled WASM (on 4.4Ghz CPU). // Given the 500ms Weight, from which 75% only are used for transactions, @@ -97,6 +103,7 @@ impl Get for WethAssetId { } } +pub type EvmAddress = sp_core::H160; type WethCurrency = CurrencyAdapter; parameter_types! { @@ -183,10 +190,12 @@ impl pallet_evm_accounts::EvmNonceProvider for EvmNonceProvider { } } +type EvmAccounts = pallet_evm_accounts::Pallet; + impl pallet_evm_accounts::Config for crate::Runtime { type RuntimeEvent = crate::RuntimeEvent; - type FeeMultiplier = sp_core::ConstU32<50>; type EvmNonceProvider = EvmNonceProvider; + type FeeMultiplier = sp_core::ConstU32<50>; type ControllerOrigin = crate::SuperMajorityTechCommittee; type WeightInfo = crate::weights::pallet_evm_accounts::HydraWeight; } diff --git a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs index 22474cb4a..fcb75f1ff 100644 --- a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs +++ b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs @@ -19,7 +19,7 @@ // you may not use this file except in compliance with the License. // http://www.apache.org/licenses/LICENSE-2.0 -use crate::evm::precompiles::EvmAddress; +use crate::evm::EvmAddress; use hex_literal::hex; use primitive_types::H160; use primitives::AssetId; diff --git a/runtime/hydradx/src/evm/precompiles/mod.rs b/runtime/hydradx/src/evm/precompiles/mod.rs index 2097fe83e..69a29867a 100644 --- a/runtime/hydradx/src/evm/precompiles/mod.rs +++ b/runtime/hydradx/src/evm/precompiles/mod.rs @@ -51,8 +51,6 @@ pub type EvmResult = Result; #[cfg(test)] mod tests; -pub type EvmAddress = sp_core::H160; - /// The `address` type of Solidity. /// H160 could represent 2 types of data (bytes20 and address) that are not encoded the same way. /// To avoid issues writing H160 is thus not supported. @@ -104,7 +102,7 @@ fn is_standard_precompile(address: H160) -> bool { impl PrecompileSet for HydraDXPrecompiles where - R: pallet_evm::Config + pallet_currencies::Config, + R: pallet_evm::Config + pallet_currencies::Config + pallet_evm_accounts::Config, R::RuntimeCall: Dispatchable + GetDispatchInfo + Decode, ::RuntimeOrigin: From>, MultiCurrencyPrecompile: Precompile, diff --git a/runtime/hydradx/src/evm/precompiles/multicurrency.rs b/runtime/hydradx/src/evm/precompiles/multicurrency.rs index b9eb7d568..0e0916267 100644 --- a/runtime/hydradx/src/evm/precompiles/multicurrency.rs +++ b/runtime/hydradx/src/evm/precompiles/multicurrency.rs @@ -19,6 +19,8 @@ // you may not use this file except in compliance with the License. // http://www.apache.org/licenses/LICENSE-2.0 +use crate::evm::erc20_currency::Function; +use crate::evm::precompiles::revert; use crate::{ evm::{ precompiles::{ @@ -32,41 +34,32 @@ use crate::{ Currencies, }; use codec::EncodeLike; -use frame_support::traits::OriginTrait; +use frame_support::traits::{IsType, OriginTrait}; +use hydradx_traits::evm::InspectEvmAccounts; use hydradx_traits::registry::Inspect as InspectRegistry; -use num_enum::{IntoPrimitive, TryFromPrimitive}; use orml_traits::{MultiCurrency as MultiCurrencyT, MultiCurrency}; use pallet_evm::{AddressMapping, ExitRevert, Precompile, PrecompileFailure, PrecompileHandle, PrecompileResult}; use primitive_types::H160; use primitives::{AssetId, Balance}; -use sp_runtime::{traits::Dispatchable, RuntimeDebug}; -use sp_std::{marker::PhantomData, prelude::*}; - -#[module_evm_utility_macro::generate_function_selector] -#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] -#[repr(u32)] -pub enum Action { - Name = "name()", - Symbol = "symbol()", - Decimals = "decimals()", - TotalSupply = "totalSupply()", - BalanceOf = "balanceOf(address)", - Allowance = "allowance(address,address)", - Transfer = "transfer(address,uint256)", - Approve = "approve(address,uint256)", - TransferFrom = "transferFrom(address,address,uint256)", -} +use sp_runtime::traits::Dispatchable; +use sp_std::marker::PhantomData; + pub struct MultiCurrencyPrecompile(PhantomData); impl Precompile for MultiCurrencyPrecompile where - Runtime: frame_system::Config + pallet_evm::Config + pallet_asset_registry::Config + pallet_currencies::Config, + Runtime: frame_system::Config + + pallet_evm::Config + + pallet_asset_registry::Config + + pallet_currencies::Config + + pallet_evm_accounts::Config, AssetId: EncodeLike<::AssetId>, <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, - ::AssetId: core::convert::From, + ::AssetId: From, Currencies: MultiCurrency, pallet_currencies::Pallet: MultiCurrency, - ::AccountId: core::convert::From, + ::AccountId: + From + IsType + AsRef<[u8; 32]>, <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, { fn execute(handle: &mut impl PrecompileHandle) -> pallet_evm::PrecompileResult { @@ -80,20 +73,20 @@ where }; handle.check_function_modifier(match selector { - Action::Transfer => FunctionModifier::NonPayable, + Function::Transfer => FunctionModifier::NonPayable, _ => FunctionModifier::View, })?; return match selector { - Action::Name => Self::name(asset_id, handle), - Action::Symbol => Self::symbol(asset_id, handle), - Action::Decimals => Self::decimals(asset_id, handle), - Action::TotalSupply => Self::total_supply(asset_id, handle), - Action::BalanceOf => Self::balance_of(asset_id, handle), - Action::Transfer => Self::transfer(asset_id, handle), - Action::Allowance => Self::not_supported(asset_id, handle), - Action::Approve => Self::not_supported(asset_id, handle), - Action::TransferFrom => Self::not_supported(asset_id, handle), + Function::Name => Self::name(asset_id, handle), + Function::Symbol => Self::symbol(asset_id, handle), + Function::Decimals => Self::decimals(asset_id, handle), + Function::TotalSupply => Self::total_supply(asset_id, handle), + Function::BalanceOf => Self::balance_of(asset_id, handle), + Function::Transfer => Self::transfer(asset_id, handle), + Function::Allowance => Self::allowance(handle), + Function::Approve => Self::not_supported(), + Function::TransferFrom => Self::transfer_from(asset_id, handle), }; } Err(PrecompileFailure::Revert { @@ -105,12 +98,17 @@ where impl MultiCurrencyPrecompile where - Runtime: frame_system::Config + pallet_evm::Config + pallet_asset_registry::Config + pallet_currencies::Config, + Runtime: frame_system::Config + + pallet_evm::Config + + pallet_asset_registry::Config + + pallet_currencies::Config + + pallet_evm_accounts::Config, AssetId: EncodeLike<::AssetId>, - ::AssetId: core::convert::From, + ::AssetId: From, Currencies: MultiCurrency, pallet_currencies::Pallet: MultiCurrency, - ::AccountId: core::convert::From, + ::AccountId: + From + IsType + AsRef<[u8; 32]>, <::RuntimeCall as Dispatchable>::RuntimeOrigin: OriginTrait, { fn name(asset_id: AssetId, handle: &mut impl PrecompileHandle) -> PrecompileResult { @@ -240,7 +238,67 @@ where Ok(succeed(EvmDataWriter::new().write(true).build())) } - fn not_supported(_: AssetId, _: &mut impl PrecompileHandle) -> PrecompileResult { + fn allowance(handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(2)?; + + let _owner: H160 = input.read::
()?.into(); + let spender: H160 = input.read::
()?.into(); + + let allowance = + if as InspectEvmAccounts>::is_approved_contract( + spender, + ) { + u128::MAX + } else { + 0 + }; + + let encoded = Output::encode_uint::(allowance); + Ok(succeed(encoded)) + } + + fn transfer_from(asset_id: AssetId, handle: &mut impl PrecompileHandle) -> PrecompileResult { + handle.record_cost(RuntimeHelper::::db_read_gas_cost())?; + + // Parse input + let mut input = handle.read_input()?; + input.expect_arguments(3)?; + + let origin: H160 = handle.context().caller.into(); + let from: H160 = input.read::
()?.into(); + let to: H160 = input.read::
()?.into(); + let amount = input.read::()?; + + let from = ExtendedAddressMapping::into_account_id(from); + let to = ExtendedAddressMapping::into_account_id(to); + + log::debug!(target: "evm", "multicurrency: transferFrom from: {:?}, to: {:?}, amount: {:?}", from, to, amount); + + if as InspectEvmAccounts>::is_approved_contract( + origin, + ) { + as MultiCurrency>::transfer( + asset_id, + &(>::into(from)), + &(>::into(to)), + amount, + ) + .map_err(|e| PrecompileFailure::Revert { + exit_status: ExitRevert::Reverted, + output: Into::<&str>::into(e).as_bytes().to_vec(), + })?; + + Ok(succeed(EvmDataWriter::new().write(true).build())) + } else { + Err(revert("Not approved contract")) + } + } + + fn not_supported() -> PrecompileResult { Err(PrecompileFailure::Error { exit_status: pallet_evm::ExitError::Other("not supported".into()), }) diff --git a/runtime/hydradx/src/weights/pallet_evm_accounts.rs b/runtime/hydradx/src/weights/pallet_evm_accounts.rs index e378bb693..d5c1d1881 100644 --- a/runtime/hydradx/src/weights/pallet_evm_accounts.rs +++ b/runtime/hydradx/src/weights/pallet_evm_accounts.rs @@ -108,4 +108,22 @@ impl pallet_evm_accounts::WeightInfo for HydraWeight Weight::from_parts(9_685_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } -} \ No newline at end of file + + fn approve_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_421_000 picoseconds. + Weight::from_parts(9_685_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } + + fn disapprove_contract() -> Weight { + // Proof Size summary in bytes: + // Measured: `0` + // Estimated: `0` + // Minimum execution time: 9_421_000 picoseconds. + Weight::from_parts(9_685_000, 0) + .saturating_add(T::DbWeight::get().writes(1_u64)) + } +} diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index 57713434a..39027b7ac 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -42,6 +42,12 @@ impl From for Option { } } +impl From for MultiLocation { + fn from(location: AssetLocation) -> Self { + location.0 + } +} + impl TryFrom for AssetLocation { type Error = (); diff --git a/scripts/test-contracts/.gitignore b/scripts/test-contracts/.gitignore new file mode 100644 index 000000000..8b80a9b4c --- /dev/null +++ b/scripts/test-contracts/.gitignore @@ -0,0 +1,20 @@ +node_modules +.env + +*.dbg.json + +# Hardhat files +/cache +/artifacts/* +!/artifacts/contracts + +# TypeChain files +/typechain +/typechain-types + +# solidity-coverage files +/coverage +/coverage.json + +# Hardhat Ignition default folder for deployments against a local node +ignition/deployments/chain-31337 diff --git a/scripts/test-contracts/README.md b/scripts/test-contracts/README.md new file mode 100644 index 000000000..2dca27974 --- /dev/null +++ b/scripts/test-contracts/README.md @@ -0,0 +1,3 @@ +``` +npx hardhat compile +``` diff --git a/scripts/test-contracts/artifacts/contracts/HydraToken.sol/HydraToken.json b/scripts/test-contracts/artifacts/contracts/HydraToken.sol/HydraToken.json new file mode 100644 index 000000000..a92b80a05 --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/HydraToken.sol/HydraToken.json @@ -0,0 +1,324 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HydraToken", + "sourceName": "contracts/HydraToken.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600581526020017f48796472610000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f485944524100000000000000000000000000000000000000000000000000000081525081600390816200008f91906200062a565b508060049081620000a191906200062a565b505050620000e433620000b9620000ea60201b60201c565b600a620000c79190620008a1565b633b9aca00620000d89190620008f2565b620000f360201b60201c565b62000a45565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001685760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016200015f919062000982565b60405180910390fd5b6200017c600083836200018060201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620001d6578060026000828254620001c991906200099f565b92505081905550620002ac565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000265578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200025c93929190620009eb565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002f7578060026000828254039250508190555062000344565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000a28565b60405180910390a3505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200043257607f821691505b602082108103620004485762000447620003ea565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004b27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000473565b620004be868362000473565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200050b62000505620004ff84620004d6565b620004e0565b620004d6565b9050919050565b6000819050919050565b6200052783620004ea565b6200053f620005368262000512565b84845462000480565b825550505050565b600090565b6200055662000547565b620005638184846200051c565b505050565b5b818110156200058b576200057f6000826200054c565b60018101905062000569565b5050565b601f821115620005da57620005a4816200044e565b620005af8462000463565b81016020851015620005bf578190505b620005d7620005ce8562000463565b83018262000568565b50505b505050565b600082821c905092915050565b6000620005ff60001984600802620005df565b1980831691505092915050565b60006200061a8383620005ec565b9150826002028217905092915050565b6200063582620003b0565b67ffffffffffffffff811115620006515762000650620003bb565b5b6200065d825462000419565b6200066a8282856200058f565b600060209050601f831160018114620006a257600084156200068d578287015190505b6200069985826200060c565b86555062000709565b601f198416620006b2866200044e565b60005b82811015620006dc57848901518255600182019150602085019450602081019050620006b5565b86831015620006fc5784890151620006f8601f891682620005ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b60018511156200079f5780860481111562000777576200077662000711565b5b6001851615620007875780820291505b8081029050620007978562000740565b945062000757565b94509492505050565b600082620007ba57600190506200088d565b81620007ca57600090506200088d565b8160018114620007e35760028114620007ee5762000824565b60019150506200088d565b60ff84111562000803576200080262000711565b5b8360020a9150848211156200081d576200081c62000711565b5b506200088d565b5060208310610133831016604e8410600b84101617156200085e5782820a90508381111562000858576200085762000711565b5b6200088d565b6200086d84848460016200074d565b9250905081840481111562000887576200088662000711565b5b81810290505b9392505050565b600060ff82169050919050565b6000620008ae82620004d6565b9150620008bb8362000894565b9250620008ea7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007a8565b905092915050565b6000620008ff82620004d6565b91506200090c83620004d6565b92508282026200091c81620004d6565b9150828204841483151762000936576200093562000711565b5b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200096a826200093d565b9050919050565b6200097c816200095d565b82525050565b600060208201905062000999600083018462000971565b92915050565b6000620009ac82620004d6565b9150620009b983620004d6565b9250828201905080821115620009d457620009d362000711565b5b92915050565b620009e581620004d6565b82525050565b600060608201905062000a02600083018662000971565b62000a116020830185620009da565b62000a206040830184620009da565b949350505050565b600060208201905062000a3f6000830184620009da565b92915050565b610e558062000a556000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/scripts/test-contracts/contracts/HydraToken.sol b/scripts/test-contracts/contracts/HydraToken.sol new file mode 100644 index 000000000..7999ff5b7 --- /dev/null +++ b/scripts/test-contracts/contracts/HydraToken.sol @@ -0,0 +1,10 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; + +contract HydraToken is ERC20 { + constructor() ERC20("Hydra", "HYDRA") { + _mint(msg.sender, 1_000_000_000 * 10 ** decimals()); + } +} diff --git a/scripts/test-contracts/hardhat.config.js b/scripts/test-contracts/hardhat.config.js new file mode 100644 index 000000000..8ba99bc91 --- /dev/null +++ b/scripts/test-contracts/hardhat.config.js @@ -0,0 +1,6 @@ +require("@nomicfoundation/hardhat-toolbox"); + +/** @type import('hardhat/config').HardhatUserConfig */ +module.exports = { + solidity: "0.8.24", +}; diff --git a/scripts/test-contracts/package-lock.json b/scripts/test-contracts/package-lock.json new file mode 100644 index 000000000..a98c3390f --- /dev/null +++ b/scripts/test-contracts/package-lock.json @@ -0,0 +1,7694 @@ +{ + "name": "test-contract", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "test-contract", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "@openzeppelin/contracts": "^5.0.2" + }, + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "hardhat": "^2.22.10" + } + }, + "node_modules/@adraffy/ens-normalize": { + "version": "1.10.1", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", + "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", + "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/trace-mapping": "0.3.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@ethereumjs/rlp": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@ethereumjs/rlp/-/rlp-4.0.1.tgz", + "integrity": "sha512-tqsQiBQDQdmPWE1xkkBq4rlSW5QZpLOUJ5RJh2/9fug+q9tnUhuZoVLk7s0scUIKTOzEtR72DFBXI4WiZcMpvw==", + "dev": true, + "license": "MPL-2.0", + "peer": true, + "bin": { + "rlp": "bin/rlp" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/@ethereumjs/util/-/util-8.1.0.tgz", + "integrity": "sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==", + "dev": true, + "license": "MPL-2.0", + "peer": true, + "dependencies": { + "@ethereumjs/rlp": "^4.0.1", + "ethereum-cryptography": "^2.0.0", + "micro-ftch": "^0.3.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@ethereumjs/util/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/@ethersproject/abi": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", + "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-provider": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", + "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0" + } + }, + "node_modules/@ethersproject/abstract-signer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", + "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/address": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", + "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/rlp": "^5.7.0" + } + }, + "node_modules/@ethersproject/base64": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", + "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0" + } + }, + "node_modules/@ethersproject/basex": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", + "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/properties": "^5.7.0" + } + }, + "node_modules/@ethersproject/bignumber": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", + "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "bn.js": "^5.2.1" + } + }, + "node_modules/@ethersproject/bytes": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", + "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/constants": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", + "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bignumber": "^5.7.0" + } + }, + "node_modules/@ethersproject/contracts": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", + "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.7.0", + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/transactions": "^5.7.0" + } + }, + "node_modules/@ethersproject/hash": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", + "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/hdnode": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", + "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/json-wallets": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", + "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/pbkdf2": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "aes-js": "3.0.0", + "scrypt-js": "3.0.1" + } + }, + "node_modules/@ethersproject/json-wallets/node_modules/aes-js": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", + "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@ethersproject/keccak256": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", + "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "js-sha3": "0.8.0" + } + }, + "node_modules/@ethersproject/logger": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", + "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT" + }, + "node_modules/@ethersproject/networks": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", + "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/pbkdf2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", + "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/sha2": "^5.7.0" + } + }, + "node_modules/@ethersproject/properties": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", + "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/providers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", + "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/base64": "^5.7.0", + "@ethersproject/basex": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/networks": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/web": "^5.7.0", + "bech32": "1.1.4", + "ws": "7.4.6" + } + }, + "node_modules/@ethersproject/providers/node_modules/ws": { + "version": "7.4.6", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", + "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/@ethersproject/random": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", + "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/rlp": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", + "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/sha2": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", + "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/signing-key": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", + "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "bn.js": "^5.2.1", + "elliptic": "6.5.4", + "hash.js": "1.1.7" + } + }, + "node_modules/@ethersproject/solidity": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", + "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/sha2": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/strings": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", + "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/transactions": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", + "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/rlp": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0" + } + }, + "node_modules/@ethersproject/units": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", + "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/constants": "^5.7.0", + "@ethersproject/logger": "^5.7.0" + } + }, + "node_modules/@ethersproject/wallet": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", + "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abstract-provider": "^5.7.0", + "@ethersproject/abstract-signer": "^5.7.0", + "@ethersproject/address": "^5.7.0", + "@ethersproject/bignumber": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/hdnode": "^5.7.0", + "@ethersproject/json-wallets": "^5.7.0", + "@ethersproject/keccak256": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/random": "^5.7.0", + "@ethersproject/signing-key": "^5.7.0", + "@ethersproject/transactions": "^5.7.0", + "@ethersproject/wordlists": "^5.7.0" + } + }, + "node_modules/@ethersproject/web": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", + "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "dependencies": { + "@ethersproject/base64": "^5.7.0", + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@ethersproject/wordlists": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", + "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bytes": "^5.7.0", + "@ethersproject/hash": "^5.7.0", + "@ethersproject/logger": "^5.7.0", + "@ethersproject/properties": "^5.7.0", + "@ethersproject/strings": "^5.7.0" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz", + "integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", + "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" + } + }, + "node_modules/@metamask/eth-sig-util": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@metamask/eth-sig-util/-/eth-sig-util-4.0.1.tgz", + "integrity": "sha512-tghyZKLHZjcdlDqCA3gNZmLeR0XvOE9U1qoQO9ohyAZT6Pya+H9vkBPcsyXytmYLNgVoin7CKCmweo/R43V+tQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "ethereumjs-abi": "^0.6.8", + "ethereumjs-util": "^6.2.1", + "ethjs-util": "^0.1.6", + "tweetnacl": "^1.0.3", + "tweetnacl-util": "^0.15.1" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/@noble/curves": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", + "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "1.3.2" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/curves/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@noble/hashes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.2.0.tgz", + "integrity": "sha512-FZfhjEDbT5GRswV3C6uvLPHMiVD6lQBmpoX5+eSiPaMTXte/IKqI5dykDxzZB/WBeK/CDuQRBWarPdi3FNY2zQ==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "node_modules/@noble/secp256k1": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/@noble/secp256k1/-/secp256k1-1.7.1.tgz", + "integrity": "sha512-hOUk6AyBFmqVrv7k5WAw/LpszxVbj9gGN4JRkIX52fdFAj1UA61KXmZDvqVEm+pOyec3+fIeZB02LYa/pWOArw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT" + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nomicfoundation/edr": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr/-/edr-0.5.2.tgz", + "integrity": "sha512-hW/iLvUQZNTVjFyX/I40rtKvvDOqUEyIi96T28YaLfmPL+3LW2lxmYLUXEJ6MI14HzqxDqrLyhf6IbjAa2r3Dw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nomicfoundation/edr-darwin-arm64": "0.5.2", + "@nomicfoundation/edr-darwin-x64": "0.5.2", + "@nomicfoundation/edr-linux-arm64-gnu": "0.5.2", + "@nomicfoundation/edr-linux-arm64-musl": "0.5.2", + "@nomicfoundation/edr-linux-x64-gnu": "0.5.2", + "@nomicfoundation/edr-linux-x64-musl": "0.5.2", + "@nomicfoundation/edr-win32-x64-msvc": "0.5.2" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-arm64": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-arm64/-/edr-darwin-arm64-0.5.2.tgz", + "integrity": "sha512-Gm4wOPKhbDjGTIRyFA2QUAPfCXA1AHxYOKt3yLSGJkQkdy9a5WW+qtqKeEKHc/+4wpJSLtsGQfpzyIzggFfo/A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-darwin-x64": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-darwin-x64/-/edr-darwin-x64-0.5.2.tgz", + "integrity": "sha512-ClyABq2dFCsrYEED3/UIO0c7p4H1/4vvlswFlqUyBpOkJccr75qIYvahOSJRM62WgUFRhbSS0OJXFRwc/PwmVg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-gnu": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-gnu/-/edr-linux-arm64-gnu-0.5.2.tgz", + "integrity": "sha512-HWMTVk1iOabfvU2RvrKLDgtFjJZTC42CpHiw2h6rfpsgRqMahvIlx2jdjWYzFNy1jZKPTN1AStQ/91MRrg5KnA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-arm64-musl": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-arm64-musl/-/edr-linux-arm64-musl-0.5.2.tgz", + "integrity": "sha512-CwsQ10xFx/QAD5y3/g5alm9+jFVuhc7uYMhrZAu9UVF+KtVjeCvafj0PaVsZ8qyijjqVuVsJ8hD1x5ob7SMcGg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-gnu": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-gnu/-/edr-linux-x64-gnu-0.5.2.tgz", + "integrity": "sha512-CWVCEdhWJ3fmUpzWHCRnC0/VLBDbqtqTGTR6yyY1Ep3S3BOrHEAvt7h5gx85r2vLcztisu2vlDq51auie4IU1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-linux-x64-musl": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-linux-x64-musl/-/edr-linux-x64-musl-0.5.2.tgz", + "integrity": "sha512-+aJDfwhkddy2pP5u1ISg3IZVAm0dO836tRlDTFWtvvSMQ5hRGqPcWwlsbobhDQsIxhPJyT7phL0orCg5W3WMeA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/edr-win32-x64-msvc": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/edr-win32-x64-msvc/-/edr-win32-x64-msvc-0.5.2.tgz", + "integrity": "sha512-CcvvuA3sAv7liFNPsIR/68YlH6rrybKzYttLlMr80d4GKJjwJ5OKb3YgE6FdZZnOfP19HEHhsLcE0DPLtY3r0w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 18" + } + }, + "node_modules/@nomicfoundation/ethereumjs-common": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-common/-/ethereumjs-common-4.0.4.tgz", + "integrity": "sha512-9Rgb658lcWsjiicr5GzNCjI1llow/7r0k50dLL95OJ+6iZJcVbi15r3Y0xh2cIO+zgX0WIHcbzIu6FeQf9KPrg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@nomicfoundation/ethereumjs-util": "9.0.4" + } + }, + "node_modules/@nomicfoundation/ethereumjs-rlp": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-rlp/-/ethereumjs-rlp-5.0.4.tgz", + "integrity": "sha512-8H1S3s8F6QueOc/X92SdrA4RDenpiAEqMg5vJH99kcQaCy/a3Q6fgseo75mgWlbanGJXSlAPtnCeG9jvfTYXlw==", + "dev": true, + "license": "MPL-2.0", + "bin": { + "rlp": "bin/rlp.cjs" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@nomicfoundation/ethereumjs-tx": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-tx/-/ethereumjs-tx-5.0.4.tgz", + "integrity": "sha512-Xjv8wAKJGMrP1f0n2PeyfFCCojHd7iS3s/Ab7qzF1S64kxZ8Z22LCMynArYsVqiFx6rzYy548HNVEyI+AYN/kw==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-common": "4.0.4", + "@nomicfoundation/ethereumjs-rlp": "5.0.4", + "@nomicfoundation/ethereumjs-util": "9.0.4", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "c-kzg": "^2.1.2" + }, + "peerDependenciesMeta": { + "c-kzg": { + "optional": true + } + } + }, + "node_modules/@nomicfoundation/ethereumjs-tx/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/ethereumjs-util": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ethereumjs-util/-/ethereumjs-util-9.0.4.tgz", + "integrity": "sha512-sLOzjnSrlx9Bb9EFNtHzK/FJFsfg2re6bsGqinFinH1gCqVfz9YYlXiMWwDM4C/L4ywuHFCYwfKTVr/QHQcU0Q==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@nomicfoundation/ethereumjs-rlp": "5.0.4", + "ethereum-cryptography": "0.1.3" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "c-kzg": "^2.1.2" + }, + "peerDependenciesMeta": { + "c-kzg": { + "optional": true + } + } + }, + "node_modules/@nomicfoundation/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/hardhat-chai-matchers": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-chai-matchers/-/hardhat-chai-matchers-2.0.7.tgz", + "integrity": "sha512-RQfsiTwdf0SP+DtuNYvm4921X6VirCQq0Xyh+mnuGlTwEFSPZ/o27oQC+l+3Y/l48DDU7+ZcYBR+Fp+Rp94LfQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/chai-as-promised": "^7.1.3", + "chai-as-promised": "^7.1.1", + "deep-eql": "^4.0.1", + "ordinal": "^1.0.3" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "chai": "^4.2.0", + "ethers": "^6.1.0", + "hardhat": "^2.9.4" + } + }, + "node_modules/@nomicfoundation/hardhat-ethers": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz", + "integrity": "sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "debug": "^4.1.1", + "lodash.isequal": "^4.5.0" + }, + "peerDependencies": { + "ethers": "^6.1.0", + "hardhat": "^2.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.5.tgz", + "integrity": "sha512-Y5nhFXFqt4owA6Ooag8ZBFDF2RAZElMXViknVIsi3m45pbQimS50ti6FU8HxfRkDnBARa40CIn7UGV0hrelzDw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nomicfoundation/ignition-core": "^0.15.5", + "@nomicfoundation/ignition-ui": "^0.15.5", + "chalk": "^4.0.0", + "debug": "^4.3.2", + "fs-extra": "^10.0.0", + "prompts": "^2.4.2" + }, + "peerDependencies": { + "@nomicfoundation/hardhat-verify": "^2.0.1", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition-ethers": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.5.tgz", + "integrity": "sha512-W6s1QN9CFxzSVZS6w9Jcj3WLaK32z2FP5MxNU2OKY1Fn9ZzLr+miXbUbWYuRHl6dxrrl6sE8cv33Cybv19pmCg==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.4", + "@nomicfoundation/hardhat-ignition": "^0.15.5", + "@nomicfoundation/ignition-core": "^0.15.5", + "ethers": "^6.7.0", + "hardhat": "^2.18.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/@nomicfoundation/hardhat-ignition/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-network-helpers/-/hardhat-network-helpers-1.0.11.tgz", + "integrity": "sha512-uGPL7QSKvxrHRU69dx8jzoBvuztlLCtyFsbgfXIwIjnO3dqZRz2GNMHJoO3C3dIiUNM6jdNF4AUnoQKDscdYrA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ethereumjs-util": "^7.1.4" + }, + "peerDependencies": { + "hardhat": "^2.9.5" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/@nomicfoundation/hardhat-network-helpers/node_modules/ethereumjs-util": { + "version": "7.1.5", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", + "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", + "dev": true, + "license": "MPL-2.0", + "peer": true, + "dependencies": { + "@types/bn.js": "^5.1.0", + "bn.js": "^5.1.2", + "create-hash": "^1.1.2", + "ethereum-cryptography": "^0.1.3", + "rlp": "^2.2.4" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/@nomicfoundation/hardhat-toolbox": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-toolbox/-/hardhat-toolbox-5.0.0.tgz", + "integrity": "sha512-FnUtUC5PsakCbwiVNsqlXVIWG5JIb5CEZoSXbJUsEBun22Bivx2jhF1/q9iQbzuaGpJKFQyOhemPB2+XlEE6pQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "@nomicfoundation/hardhat-chai-matchers": "^2.0.0", + "@nomicfoundation/hardhat-ethers": "^3.0.0", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.0", + "@nomicfoundation/hardhat-network-helpers": "^1.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.0", + "@typechain/ethers-v6": "^0.5.0", + "@typechain/hardhat": "^9.0.0", + "@types/chai": "^4.2.0", + "@types/mocha": ">=9.1.0", + "@types/node": ">=18.0.0", + "chai": "^4.2.0", + "ethers": "^6.4.0", + "hardhat": "^2.11.0", + "hardhat-gas-reporter": "^1.0.8", + "solidity-coverage": "^0.8.1", + "ts-node": ">=8.0.0", + "typechain": "^8.3.0", + "typescript": ">=4.5.0" + } + }, + "node_modules/@nomicfoundation/hardhat-verify": { + "version": "2.0.10", + "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.10.tgz", + "integrity": "sha512-3zoTZGQhpeOm6piJDdsGb6euzZAd7N5Tk0zPQvGnfKQ0+AoxKz/7i4if12goi8IDTuUGElAUuZyQB8PMQoXA5g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@ethersproject/address": "^5.0.2", + "cbor": "^8.1.0", + "chalk": "^2.4.2", + "debug": "^4.1.1", + "lodash.clonedeep": "^4.5.0", + "semver": "^6.3.0", + "table": "^6.8.0", + "undici": "^5.14.0" + }, + "peerDependencies": { + "hardhat": "^2.0.4" + } + }, + "node_modules/@nomicfoundation/ignition-core": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.5.tgz", + "integrity": "sha512-FgvuoIXhakRSP524JzNQ4BviyzBBKpsFaOWubPZ4XACLT4/7vGqlJ/7DIn0D2NL2anQ2qs98/BNBY9WccXUX1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/address": "5.6.1", + "@nomicfoundation/solidity-analyzer": "^0.1.1", + "cbor": "^9.0.0", + "debug": "^4.3.2", + "ethers": "^6.7.0", + "fs-extra": "^10.0.0", + "immer": "10.0.2", + "lodash": "4.17.21", + "ndjson": "2.0.0" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/@ethersproject/address": { + "version": "5.6.1", + "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.6.1.tgz", + "integrity": "sha512-uOgF0kS5MJv9ZvCz7x6T2EXJSzotiybApn4XlOgoTX0xdtyVIJ7pF+6cGPxiEq/dpBiTfMiw7Yc81JcwhSYA0Q==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/bignumber": "^5.6.2", + "@ethersproject/bytes": "^5.6.1", + "@ethersproject/keccak256": "^5.6.1", + "@ethersproject/logger": "^5.6.0", + "@ethersproject/rlp": "^5.6.1" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/cbor": { + "version": "9.0.2", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-9.0.2.tgz", + "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@nomicfoundation/ignition-core/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@nomicfoundation/ignition-ui": { + "version": "0.15.5", + "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.5.tgz", + "integrity": "sha512-ZcE4rIn10qKahR4OqS8rl8NM2Fbg2QYiBXgMgj74ZI0++LlCcZgB5HyaBbX+lsnKHjTXtjYD3b+2mtg7jFbAMQ==", + "dev": true, + "peer": true + }, + "node_modules/@nomicfoundation/solidity-analyzer": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer/-/solidity-analyzer-0.1.2.tgz", + "integrity": "sha512-q4n32/FNKIhQ3zQGGw5CvPF6GTvDCpYwIf7bEY/dZTZbgfDsHyjJwURxUJf3VQuuJj+fDIFl4+KkBVbw4Ef6jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + }, + "optionalDependencies": { + "@nomicfoundation/solidity-analyzer-darwin-arm64": "0.1.2", + "@nomicfoundation/solidity-analyzer-darwin-x64": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-arm64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-gnu": "0.1.2", + "@nomicfoundation/solidity-analyzer-linux-x64-musl": "0.1.2", + "@nomicfoundation/solidity-analyzer-win32-x64-msvc": "0.1.2" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-arm64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-arm64/-/solidity-analyzer-darwin-arm64-0.1.2.tgz", + "integrity": "sha512-JaqcWPDZENCvm++lFFGjrDd8mxtf+CtLd2MiXvMNTBD33dContTZ9TWETwNFwg7JTJT5Q9HEecH7FA+HTSsIUw==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-darwin-x64": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-darwin-x64/-/solidity-analyzer-darwin-x64-0.1.2.tgz", + "integrity": "sha512-fZNmVztrSXC03e9RONBT+CiksSeYcxI1wlzqyr0L7hsQlK1fzV+f04g2JtQ1c/Fe74ZwdV6aQBdd6Uwl1052sw==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-gnu/-/solidity-analyzer-linux-arm64-gnu-0.1.2.tgz", + "integrity": "sha512-3d54oc+9ZVBuB6nbp8wHylk4xh0N0Gc+bk+/uJae+rUgbOBwQSfuGIbAZt1wBXs5REkSmynEGcqx6DutoK0tPA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-arm64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-arm64-musl/-/solidity-analyzer-linux-arm64-musl-0.1.2.tgz", + "integrity": "sha512-iDJfR2qf55vgsg7BtJa7iPiFAsYf2d0Tv/0B+vhtnI16+wfQeTbP7teookbGvAo0eJo7aLLm0xfS/GTkvHIucA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-gnu": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-gnu/-/solidity-analyzer-linux-x64-gnu-0.1.2.tgz", + "integrity": "sha512-9dlHMAt5/2cpWyuJ9fQNOUXFB/vgSFORg1jpjX1Mh9hJ/MfZXlDdHQ+DpFCs32Zk5pxRBb07yGvSHk9/fezL+g==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-linux-x64-musl": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-linux-x64-musl/-/solidity-analyzer-linux-x64-musl-0.1.2.tgz", + "integrity": "sha512-GzzVeeJob3lfrSlDKQw2bRJ8rBf6mEYaWY+gW0JnTDHINA0s2gPR4km5RLIj1xeZZOYz4zRw+AEeYgLRqB2NXg==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@nomicfoundation/solidity-analyzer-win32-x64-msvc": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/@nomicfoundation/solidity-analyzer-win32-x64-msvc/-/solidity-analyzer-win32-x64-msvc-0.1.2.tgz", + "integrity": "sha512-Fdjli4DCcFHb4Zgsz0uEJXZ2K7VEO+w5KVv7HmT7WO10iODdU9csC2az4jrhEsRtiR9Gfd74FlG0NYlw1BMdyA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 12" + } + }, + "node_modules/@openzeppelin/contracts": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/@openzeppelin/contracts/-/contracts-5.0.2.tgz", + "integrity": "sha512-ytPc6eLGcHHnapAZ9S+5qsdomhjo6QBHTDRRBFfTxXIpsicMhVPouPgmUPebZZZGX7vt9USA+Z+0M0dSVtSUEA==", + "license": "MIT" + }, + "node_modules/@scure/base": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.8.tgz", + "integrity": "sha512-6CyAclxj3Nb0XT7GHK6K4zK6k2xJm6E4Ft0Ohjt4WgegiFUHEtFb2CGzmPmGBwoIhrLsqNLYfLr04Y1GePrzZg==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@scure/bip32": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.1.5.tgz", + "integrity": "sha512-XyNh1rB0SkEqd3tXcXMi+Xe1fvg+kUIcoRIEujP1Jgv7DqW2r9lg3Ah0NkFaCs9sTkQAQA8kw7xiRXzENi9Rtw==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.2.0", + "@noble/secp256k1": "~1.7.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@scure/bip39": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.1.1.tgz", + "integrity": "sha512-t+wDck2rVkh65Hmv280fYdVdY25J9YeEUIgn2LG1WM6gxFkGzcksoDiUkWVpVp3Oex9xGC68JU2dSbUfwZ2jPg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "@noble/hashes": "~1.2.0", + "@scure/base": "~1.1.0" + } + }, + "node_modules/@sentry/core": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", + "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/hub": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", + "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/minimal": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", + "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/node": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/node/-/node-5.30.0.tgz", + "integrity": "sha512-Br5oyVBF0fZo6ZS9bxbJZG4ApAjRqAnqFFurMVJJdunNb80brh7a5Qva2kjhm+U6r9NJAB5OmDyPkA1Qnt+QVg==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/core": "5.30.0", + "@sentry/hub": "5.30.0", + "@sentry/tracing": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/tracing": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/tracing/-/tracing-5.30.0.tgz", + "integrity": "sha512-dUFowCr0AIMwiLD7Fs314Mdzcug+gBVo/+NCMyDw8tFxJkwWAKl7Qa2OZxLQ0ZHjakcj1hNKfCQJ9rhyfOl4Aw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/types": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", + "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=6" + } + }, + "node_modules/@sentry/utils": { + "version": "5.30.0", + "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", + "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/@solidity-parser/parser": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.14.5.tgz", + "integrity": "sha512-6dKnHZn7fg/iQATVEzqyUOyEidbn05q7YA2mQ9hC0MMXhhV3/JrsxmFSYZAcr7j1yUP700LLhTruvJ3MiQmjJg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "antlr4ts": "^0.5.0-alpha.4" + } + }, + "node_modules/@tsconfig/node10": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.11.tgz", + "integrity": "sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@tsconfig/node12": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.11.tgz", + "integrity": "sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@tsconfig/node14": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.3.tgz", + "integrity": "sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@tsconfig/node16": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.4.tgz", + "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@typechain/ethers-v6": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/@typechain/ethers-v6/-/ethers-v6-0.5.1.tgz", + "integrity": "sha512-F+GklO8jBWlsaVV+9oHaPh5NJdd6rAKN4tklGfInX1Q7h0xPgVLP39Jl3eCulPB5qexI71ZFHwbljx4ZXNfouA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.15", + "ts-essentials": "^7.0.1" + }, + "peerDependencies": { + "ethers": "6.x", + "typechain": "^8.3.2", + "typescript": ">=4.7.0" + } + }, + "node_modules/@typechain/hardhat": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@typechain/hardhat/-/hardhat-9.1.0.tgz", + "integrity": "sha512-mtaUlzLlkqTlfPwB3FORdejqBskSnh+Jl8AIJGjXNAQfRQ4ofHADPl1+oU7Z3pAJzmZbUXII8MhOLQltcHgKnA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fs-extra": "^9.1.0" + }, + "peerDependencies": { + "@typechain/ethers-v6": "^0.5.1", + "ethers": "^6.1.0", + "hardhat": "^2.9.9", + "typechain": "^8.3.2" + } + }, + "node_modules/@typechain/hardhat/node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@typechain/hardhat/node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/@typechain/hardhat/node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/@types/bn.js": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.5.tgz", + "integrity": "sha512-V46N0zwKRF5Q00AZ6hWtN0T8gGmDUaUzLWQvHFo5yThtVwK/VCenFY3wXVbOvNfajEpsTfQM4IN9k/d6gUVX3A==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/chai": { + "version": "4.3.19", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.19.tgz", + "integrity": "sha512-2hHHvQBVE2FiSK4eN0Br6snX9MtolHaTo/batnLjlGRhoQzlCL61iVpxoqO7SfFyOw+P/pwv+0zNHzKoGWz9Cw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/chai-as-promised": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/@types/chai-as-promised/-/chai-as-promised-7.1.8.tgz", + "integrity": "sha512-ThlRVIJhr69FLlh6IctTXFkmhtP3NpMZ2QGq69StYLyKZFp/HOp1VdKZj7RvfNWYYcJ1xlbLGLLWj1UvP5u/Gw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/chai": "*" + } + }, + "node_modules/@types/concat-stream": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/@types/concat-stream/-/concat-stream-1.6.1.tgz", + "integrity": "sha512-eHE4cQPoj6ngxBZMvVf6Hw7Mh4jMW4U9lpGmS5GBPB9RYxlFg+CHaVN7ErNY4W9XfLIEn20b4VDYaIrbq0q4uA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/form-data": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/@types/form-data/-/form-data-0.0.33.tgz", + "integrity": "sha512-8BSvG1kGm83cyJITQMZSulnl6QV8jqAGreJsc5tPu1Jq0vTSOiY/k24Wx82JRpWwZSqrala6sd5rWi6aNXvqcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/minimatch": "*", + "@types/node": "*" + } + }, + "node_modules/@types/lru-cache": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/@types/lru-cache/-/lru-cache-5.1.1.tgz", + "integrity": "sha512-ssE3Vlrys7sdIzs5LOxCzTVMsU7i9oa/IaW92wF32JFb3CVczqOkru2xspuKczHEbG3nvmPY7IFqVmGGHdNbYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/minimatch": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-5.1.2.tgz", + "integrity": "sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/mocha": { + "version": "10.0.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.7.tgz", + "integrity": "sha512-GN8yJ1mNTcFcah/wKEFIJckJx9iJLoMSzWcfRRuxz/Jk+U6KQNnml+etbtxFK8lPjzOw3zp4Ha/kjSst9fsHYw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/node": { + "version": "22.5.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.3.tgz", + "integrity": "sha512-njripolh85IA9SQGTAqbmnNZTdxv7X/4OYGPz8tgy5JDr8MP+uDBa921GpYEoDDnwm0Hmn5ZPeJgiiSTPoOzkQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "node_modules/@types/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/prettier": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", + "integrity": "sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/qs": { + "version": "6.9.15", + "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.15.tgz", + "integrity": "sha512-uXHQKES6DQKKCLh441Xv/dwxOq1TVS3JPUMlEqoEglvlhR6Mxnlew/Xq/LRVHpLyk7iK3zODe1qYHIMltO7XGg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/@types/secp256k1": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", + "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abbrev": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.9.tgz", + "integrity": "sha512-LEyx4aLEC3x6T0UguF6YILf+ntvmOaWsVfENmIW0E9H09vKlLDGelMjjSm0jkDHALj8A8quZ/HapKNigzwge+Q==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/acorn": { + "version": "8.12.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.12.1.tgz", + "integrity": "sha512-tcpGyI9zbizT9JbV6oYE477V6mTlXvvi0T0G3SNIYE2apm/G5huBa1+K89VGeovbg+jycCrfhl3ADxErOuO6Jg==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-walk": { + "version": "8.3.3", + "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.3.3.tgz", + "integrity": "sha512-MxXdReSRhGO7VlFe1bRG/oI7/mdLV9B9JJT0N8vZOhF7gFRR5l3M8W9G8JxmKV+JC5mGqJ0QvqfSOLsCPa4nUw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "acorn": "^8.11.0" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/adm-zip": { + "version": "0.4.16", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.4.16.tgz", + "integrity": "sha512-TFi4HBKSGfIKsK5YCkKaaFG2m4PEDyViZmEwof3MTIgzimHLto6muaHVpbrljdIvIrFZzEq/p4nafOeLcYegrg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.3.0" + } + }, + "node_modules/aes-js": { + "version": "4.0.0-beta.5", + "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", + "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", + "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "fast-deep-equal": "^3.1.3", + "fast-uri": "^3.0.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/amdefine": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "integrity": "sha512-S2Hw0TtNkMJhIabBwIojKL9YHO5T0n5eNqWJ7Lrlel/zDbftQpxpapi8tZs3X1HWa+u+QeydGmzzNU0m09+Rcg==", + "dev": true, + "license": "BSD-3-Clause OR MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.4.2" + } + }, + "node_modules/ansi-align": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.1.tgz", + "integrity": "sha512-IOfwwBF5iczOjp/WeY4YxyjqAFMQoZufdQWDd19SEExbVLNXqvpzSJ/M7Za4/sCPmQ0+GRquoA7bGcINcxew6w==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.1.0" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/antlr4ts": { + "version": "0.5.0-alpha.4", + "resolved": "https://registry.npmjs.org/antlr4ts/-/antlr4ts-0.5.0-alpha.4.tgz", + "integrity": "sha512-WPQDt1B74OfPv/IMS2ekXAKkTZIHl88uMetg6q3OTqgFxZ/dxDXI0EWLyZid/1Pe6hTftyg5N7gel5wNAGxXyQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/arg": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/array-back": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha512-MNha4BWQ6JbwhFhj03YK552f7cb3AzoE8SzeljgChvL1dl3IcvggXVz1DilzySZkCja+CXuZbdW7yATchWn8/Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/assertion-error": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", + "integrity": "sha512-nSVgobk4rv61R9PUSDtYt7mPVB2olxNR5RWJcAsH676/ef11bUZwvu7+RGYrYauVdDPcO519v68wRhXQtxsV9w==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "peer": true, + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/axios": { + "version": "1.7.7", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.7.tgz", + "integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base-x": { + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", + "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bech32": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", + "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/binary-extensions": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", + "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bn.js": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", + "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/boxen": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-5.1.2.tgz", + "integrity": "sha512-9gYgQKXx+1nP8mP7CzFyaUARhg7D3n1dF/FnErWmu9l6JvGpNUN278h0aSb+QjoiKSWG+iZ3uHrcqk0qrY9RQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-align": "^3.0.0", + "camelcase": "^6.2.0", + "chalk": "^4.1.0", + "cli-boxes": "^2.2.1", + "string-width": "^4.2.2", + "type-fest": "^0.20.2", + "widest-line": "^3.1.0", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/boxen/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/boxen/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/boxen/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/boxen/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/boxen/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/boxen/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/boxen/node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/brorand": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==", + "dev": true, + "license": "MIT" + }, + "node_modules/browser-stdout": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", + "dev": true, + "license": "ISC" + }, + "node_modules/browserify-aes": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-xor": "^1.0.3", + "cipher-base": "^1.0.0", + "create-hash": "^1.1.0", + "evp_bytestokey": "^1.0.3", + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "license": "MIT", + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/bs58check": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", + "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bs58": "^4.0.0", + "create-hash": "^1.1.0", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/buffer-xor": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/camelcase": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", + "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true, + "license": "Apache-2.0", + "peer": true + }, + "node_modules/cbor": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/cbor/-/cbor-8.1.0.tgz", + "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "nofilter": "^3.1.0" + }, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/chai": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", + "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "assertion-error": "^1.1.0", + "check-error": "^1.0.3", + "deep-eql": "^4.1.3", + "get-func-name": "^2.0.2", + "loupe": "^2.3.6", + "pathval": "^1.1.1", + "type-detect": "^4.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/chai-as-promised": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", + "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", + "dev": true, + "license": "WTFPL", + "peer": true, + "dependencies": { + "check-error": "^1.0.2" + }, + "peerDependencies": { + "chai": ">= 2.1.2 < 6" + } + }, + "node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/charenc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/charenc/-/charenc-0.0.2.tgz", + "integrity": "sha512-yrLQ/yVUFXkzg7EDQsPieE/53+0RlaWTs+wBrvW36cyilJ2SaDWfl4Yj7MtLTXleV9uEKefbAGUPv2/iWSooRA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/check-error": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", + "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-func-name": "^2.0.2" + }, + "engines": { + "node": "*" + } + }, + "node_modules/chokidar": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", + "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" + } + }, + "node_modules/ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cipher-base": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-boxes": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.1.tgz", + "integrity": "sha512-y4coMcylgSCdVinjiDBuR8PCC2bLjyGTwEmPb9NHR/QaNU6EUOXcTY/s6VjGMD6ENSEaeQYHCY0GNGS5jfMwPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-table3": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", + "integrity": "sha512-7Qg2Jrep1S/+Q3EceiZtQcDPWxhAvBw+ERf1162v4sikJrvojMHFqXt8QIVha8UlH9rgU0BeWPytZ9/TzYqlUw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "object-assign": "^4.1.0", + "string-width": "^2.1.1" + }, + "engines": { + "node": ">=6" + }, + "optionalDependencies": { + "colors": "^1.1.2" + } + }, + "node_modules/cli-table3/node_modules/ansi-regex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", + "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cli-table3/node_modules/strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/cliui": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", + "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true, + "license": "MIT" + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/command-exists": { + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/command-exists/-/command-exists-1.2.9.tgz", + "integrity": "sha512-LTQ/SGc+s0Xc0Fu5WaKnR0YiygZkm9eKFvyS+fRsU7/ZWFF8ykFM6Pc9aCVf1+xasOOZpO3BAVgVrKvsqKHV7w==", + "dev": true, + "license": "MIT" + }, + "node_modules/command-line-args": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.2.1.tgz", + "integrity": "sha512-H4UfQhZyakIjC74I9d34fGYDwk3XpSr17QhEd0Q3I9Xq1CETHo4Hcuo87WyWHpAF1aSLjLRf5lD9ZGX2qStUvg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.1.0", + "find-replace": "^3.0.0", + "lodash.camelcase": "^4.3.0", + "typical": "^4.0.0" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/command-line-usage": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/command-line-usage/-/command-line-usage-6.1.3.tgz", + "integrity": "sha512-sH5ZSPr+7UStsloltmDh7Ce5fb8XPlHyoPzTpyyMuYCtervL65+ubVZ6Q61cFtFl62UyJlc8/JwERRbAFPUqgw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^4.0.2", + "chalk": "^2.4.2", + "table-layout": "^1.0.2", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/command-line-usage/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/command-line-usage/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/commander": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz", + "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 12" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true, + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "1.6.2", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", + "dev": true, + "engines": [ + "node >= 0.8" + ], + "license": "MIT", + "peer": true, + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/concat-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/concat-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/cookie": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", + "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/core-util-is": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", + "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/create-hash": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.1", + "inherits": "^2.0.1", + "md5.js": "^1.3.4", + "ripemd160": "^2.0.1", + "sha.js": "^2.4.0" + } + }, + "node_modules/create-hmac": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "cipher-base": "^1.0.3", + "create-hash": "^1.1.0", + "inherits": "^2.0.1", + "ripemd160": "^2.0.0", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + } + }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/crypt": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/crypt/-/crypt-0.0.2.tgz", + "integrity": "sha512-mCxBlsHFYh9C+HVpiEacem8FEBnMXgU9gy4zmNC+SXAZNB/1idgp/aulFJ4FgCi7GPEVbfyng092GqL2k2rmow==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/death": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/death/-/death-1.1.0.tgz", + "integrity": "sha512-vsV6S4KVHvTGxbEcij7hkWRv0It+sGGWVOM67dQde/o5Xjnr+KmLjxWJii2uEObIrt1CcM9w0Yaovx+iOlIL+w==", + "dev": true, + "peer": true + }, + "node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/decamelize": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", + "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-eql": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", + "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/diff": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", + "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/difflib": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/difflib/-/difflib-0.2.4.tgz", + "integrity": "sha512-9YVwmMb0wQHQNr5J9m6BSj6fk4pfGITGQOOs+D9Fl+INODWFOfvhIU1hNv6GgR1RBoC/9NJcwu77zShxV0kT7w==", + "dev": true, + "peer": true, + "dependencies": { + "heap": ">= 0.2.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "path-type": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/elliptic": { + "version": "6.5.4", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", + "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.9", + "brorand": "^1.1.0", + "hash.js": "^1.0.0", + "hmac-drbg": "^1.0.1", + "inherits": "^2.0.4", + "minimalistic-assert": "^1.0.1", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/elliptic/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", + "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.8.1.tgz", + "integrity": "sha512-yhi5S+mNTOuRvyW4gWlg5W1byMaQGWWSYHXsuFZ7GBo7tpyOwi2EdzMP/QWxh9hwkD2m+wDVHJsxhRIj+v/b/A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "dependencies": { + "esprima": "^2.7.1", + "estraverse": "^1.9.1", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=0.12.0" + }, + "optionalDependencies": { + "source-map": "~0.2.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.2.0.tgz", + "integrity": "sha512-CBdZ2oa/BHhS4xj5DlhjWNHcan57/5YuvfdLf17iVmIpd9KRm+DFLmC6nBNj+6Ua7Kt3TmOjDpQT1aTYOQtoUA==", + "dev": true, + "optional": true, + "peer": true, + "dependencies": { + "amdefine": ">=0.0.4" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/esprima": { + "version": "2.7.3", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.7.3.tgz", + "integrity": "sha512-OarPfz0lFCiW4/AV2Oy1Rp9qu0iusTKqykwTspGCZtPxmF81JR4MmIebvF1F9+UOKth2ZubLQ4XGGaU+hSn99A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/estraverse": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-1.9.3.tgz", + "integrity": "sha512-25w1fMXQrGdoquWnScXZGckOv+Wes+JDnuN/+7ex3SauFRS72r2lFDec0EKPt2YD1wUJ/IrfEex+9yp4hfSOJA==", + "dev": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eth-gas-reporter": { + "version": "0.2.27", + "resolved": "https://registry.npmjs.org/eth-gas-reporter/-/eth-gas-reporter-0.2.27.tgz", + "integrity": "sha512-femhvoAM7wL0GcI8ozTdxfuBtBFJ9qsyIAsmKVjlWAHUbdnnXHt+lKzz/kmldM5lA9jLuNHGwuIxorNpLbR1Zw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@solidity-parser/parser": "^0.14.0", + "axios": "^1.5.1", + "cli-table3": "^0.5.0", + "colors": "1.4.0", + "ethereum-cryptography": "^1.0.3", + "ethers": "^5.7.2", + "fs-readdir-recursive": "^1.1.0", + "lodash": "^4.17.14", + "markdown-table": "^1.1.3", + "mocha": "^10.2.0", + "req-cwd": "^2.0.0", + "sha1": "^1.1.1", + "sync-request": "^6.0.0" + }, + "peerDependencies": { + "@codechecks/client": "^0.1.0" + }, + "peerDependenciesMeta": { + "@codechecks/client": { + "optional": true + } + } + }, + "node_modules/eth-gas-reporter/node_modules/ethers": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", + "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@ethersproject/abi": "5.7.0", + "@ethersproject/abstract-provider": "5.7.0", + "@ethersproject/abstract-signer": "5.7.0", + "@ethersproject/address": "5.7.0", + "@ethersproject/base64": "5.7.0", + "@ethersproject/basex": "5.7.0", + "@ethersproject/bignumber": "5.7.0", + "@ethersproject/bytes": "5.7.0", + "@ethersproject/constants": "5.7.0", + "@ethersproject/contracts": "5.7.0", + "@ethersproject/hash": "5.7.0", + "@ethersproject/hdnode": "5.7.0", + "@ethersproject/json-wallets": "5.7.0", + "@ethersproject/keccak256": "5.7.0", + "@ethersproject/logger": "5.7.0", + "@ethersproject/networks": "5.7.1", + "@ethersproject/pbkdf2": "5.7.0", + "@ethersproject/properties": "5.7.0", + "@ethersproject/providers": "5.7.2", + "@ethersproject/random": "5.7.0", + "@ethersproject/rlp": "5.7.0", + "@ethersproject/sha2": "5.7.0", + "@ethersproject/signing-key": "5.7.0", + "@ethersproject/solidity": "5.7.0", + "@ethersproject/strings": "5.7.0", + "@ethersproject/transactions": "5.7.0", + "@ethersproject/units": "5.7.0", + "@ethersproject/wallet": "5.7.0", + "@ethersproject/web": "5.7.1", + "@ethersproject/wordlists": "5.7.0" + } + }, + "node_modules/ethereum-bloom-filters": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", + "integrity": "sha512-28hyiE7HVsWubqhpVLVmZXFd4ITeHi+BUu05o9isf0GUpMtzBUi+8/gFrGaGYzvGAJQmJ3JKj77Mk9G98T84rA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "^1.4.0" + } + }, + "node_modules/ethereum-bloom-filters/node_modules/@noble/hashes": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", + "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethereum-cryptography": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-1.2.0.tgz", + "integrity": "sha512-6yFQC9b5ug6/17CQpCyE3k9eKBMdhyVjzUy1WkiuY/E4vj/SXDBbCw8QEIaXqf0Mf2SnY6RmpDcwlUmBSS0EJw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.2.0", + "@noble/secp256k1": "1.7.1", + "@scure/bip32": "1.1.5", + "@scure/bip39": "1.1.1" + } + }, + "node_modules/ethereumjs-abi": { + "version": "0.6.8", + "resolved": "https://registry.npmjs.org/ethereumjs-abi/-/ethereumjs-abi-0.6.8.tgz", + "integrity": "sha512-Tx0r/iXI6r+lRsdvkFDlut0N08jWMnKRZ6Gkq+Nmw75lZe4e6o3EkSnkaBP5NF6+m5PTGAr9JP43N3LyeoglsA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bn.js": "^4.11.8", + "ethereumjs-util": "^6.0.0" + } + }, + "node_modules/ethereumjs-abi/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ethereumjs-util": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.2.1.tgz", + "integrity": "sha512-W2Ktez4L01Vexijrm5EB6w7dg4n/TgpoYU4avuT5T3Vmnw/eCRtiBrJfQYS/DCSvDIOLn2k57GcHdeBcgVxAqw==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "@types/bn.js": "^4.11.3", + "bn.js": "^4.11.0", + "create-hash": "^1.1.2", + "elliptic": "^6.5.2", + "ethereum-cryptography": "^0.1.3", + "ethjs-util": "0.1.6", + "rlp": "^2.2.3" + } + }, + "node_modules/ethereumjs-util/node_modules/@types/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-pqr857jrp2kPuO9uRjZ3PwnJTjoQy+fcdxvBTvHm6dkmEL9q+hDD/2j/0ELOBPtPnS8LjCX0gI9nbl8lVkadpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/ethereumjs-util/node_modules/bn.js": { + "version": "4.12.0", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", + "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==", + "dev": true, + "license": "MIT" + }, + "node_modules/ethereumjs-util/node_modules/ethereum-cryptography": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", + "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/pbkdf2": "^3.0.0", + "@types/secp256k1": "^4.0.1", + "blakejs": "^1.1.0", + "browserify-aes": "^1.2.0", + "bs58check": "^2.1.2", + "create-hash": "^1.2.0", + "create-hmac": "^1.1.7", + "hash.js": "^1.1.7", + "keccak": "^3.0.0", + "pbkdf2": "^3.0.17", + "randombytes": "^2.1.0", + "safe-buffer": "^5.1.2", + "scrypt-js": "^3.0.0", + "secp256k1": "^4.0.1", + "setimmediate": "^1.0.5" + } + }, + "node_modules/ethers": { + "version": "6.13.2", + "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.2.tgz", + "integrity": "sha512-9VkriTTed+/27BGuY1s0hf441kqwHJ1wtN2edksEtiRvXx+soxRX3iSXTfFqq2+YwrOqbDoTHjIhQnjJRlzKmg==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/ethers-io/" + }, + { + "type": "individual", + "url": "https://www.buymeacoffee.com/ricmoo" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "@adraffy/ens-normalize": "1.10.1", + "@noble/curves": "1.2.0", + "@noble/hashes": "1.3.2", + "@types/node": "18.15.13", + "aes-js": "4.0.0-beta.5", + "tslib": "2.4.0", + "ws": "8.17.1" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/ethers/node_modules/@noble/hashes": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", + "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/ethers/node_modules/@types/node": { + "version": "18.15.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", + "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/ethers/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", + "dev": true, + "license": "0BSD", + "peer": true + }, + "node_modules/ethers/node_modules/ws": { + "version": "8.17.1", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", + "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/ethjs-unit": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-unit/-/ethjs-unit-0.1.6.tgz", + "integrity": "sha512-/Sn9Y0oKl0uqQuvgFk/zQgR7aw1g36qX/jzSQ5lSwlO0GigPymk4eGQfeNTD03w1dPOqfz8V77Cy43jH56pagw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "bn.js": "4.11.6", + "number-to-bn": "1.7.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/ethjs-unit/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/ethjs-util": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/evp_bytestokey": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "md5.js": "^1.3.4", + "safe-buffer": "^5.1.1" + } + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/fast-glob": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" + }, + "engines": { + "node": ">=8.6.0" + } + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/fast-uri": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", + "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/fastq": { + "version": "1.17.1", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", + "integrity": "sha512-sRVD3lWVIXWg6By68ZN7vho9a1pQcN/WBFaAAsDDFzlJjvoGx0P8z7V1t72grFJfJhu3YPZBuu25f7Kaw2jN1w==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "dev": true, + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/find-replace": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^3.0.1" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/flat": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "dev": true, + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.8", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.8.tgz", + "integrity": "sha512-xgrmBhBToVKay1q2Tao5LI26B83UhrB/vM1avwVSDzt8rx3rO6AizBAaF46EgksTVr+rFTQaqZZ9MVBfUe4nig==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fp-ts": { + "version": "1.19.3", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", + "integrity": "sha512-H5KQDspykdHuztLTg+ajGN0Z2qUjcEf3Ybxc6hLt0k7/zPkn29XnKnxlBPyW2XIddWrGaJBzBl4VLYOtk39yZg==", + "dev": true, + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, + "license": "ISC" + }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true, + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-func-name": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", + "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-port": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-3.2.0.tgz", + "integrity": "sha512-x5UJKlgeUiNT8nyo/AcnwLnZuZNcSjSw0kogRB+Whd1fjjFq4B1hySFxSFWWSn4mIBzg3sRNUDFYc4g5gjPoLg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/ghost-testrpc": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/ghost-testrpc/-/ghost-testrpc-0.0.2.tgz", + "integrity": "sha512-i08dAEgJ2g8z5buJIrCTduwPIhih3DP+hOCTyyryikfV8T0bNvHnGXO67i0DD1H4GBDETTclPy9njZbfluQYrQ==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "chalk": "^2.4.2", + "node-emoji": "^1.10.0" + }, + "bin": { + "testrpc-sc": "index.js" + } + }, + "node_modules/glob": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", + "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/global-modules": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-2.0.0.tgz", + "integrity": "sha512-NGbfmJBp9x8IxyJSd1P+otYK8vonoJactOogrVfFRIAEY1ukil8RSKDz2Yo7wh1oihl51l/r6W4epkeKJHqL8A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "global-prefix": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/global-prefix": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-3.0.0.tgz", + "integrity": "sha512-awConJSVCHVGND6x3tmMaKcQvwXLhjdkmomy2W+Goaui8YPgYgXJZewhg3fWC+DlfqqQuWg8AwqjGTD2nAPVWg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ini": "^1.3.5", + "kind-of": "^6.0.2", + "which": "^1.3.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/globby": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.2.tgz", + "integrity": "sha512-7dUi7RvCoT/xast/o/dLN53oqND4yk0nsHkhRgn9w65C4PofCLOoJ39iSOg+qVDdWQPIEj+eszMHQ+aLVwwQSg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/handlebars": { + "version": "4.7.8", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.8.tgz", + "integrity": "sha512-vafaFqs8MZkRrSX7sFVUdo3ap/eNiLnb4IakshzvP56X5Nr1iGKAIqdX6tMlm6HcNRIkr6AxO5jFEoJzzpT8aQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "minimist": "^1.2.5", + "neo-async": "^2.6.2", + "source-map": "^0.6.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "handlebars": "bin/handlebars" + }, + "engines": { + "node": ">=0.4.7" + }, + "optionalDependencies": { + "uglify-js": "^3.1.4" + } + }, + "node_modules/hardhat": { + "version": "2.22.10", + "resolved": "https://registry.npmjs.org/hardhat/-/hardhat-2.22.10.tgz", + "integrity": "sha512-JRUDdiystjniAvBGFmJRsiIZSOP2/6s++8xRDe3TzLeQXlWWHsXBrd9wd3JWFyKXvgMqMeLL5Sz/oNxXKYw9vg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@ethersproject/abi": "^5.1.2", + "@metamask/eth-sig-util": "^4.0.0", + "@nomicfoundation/edr": "^0.5.2", + "@nomicfoundation/ethereumjs-common": "4.0.4", + "@nomicfoundation/ethereumjs-tx": "5.0.4", + "@nomicfoundation/ethereumjs-util": "9.0.4", + "@nomicfoundation/solidity-analyzer": "^0.1.0", + "@sentry/node": "^5.18.1", + "@types/bn.js": "^5.1.0", + "@types/lru-cache": "^5.1.0", + "adm-zip": "^0.4.16", + "aggregate-error": "^3.0.0", + "ansi-escapes": "^4.3.0", + "boxen": "^5.1.2", + "chalk": "^2.4.2", + "chokidar": "^3.4.0", + "ci-info": "^2.0.0", + "debug": "^4.1.1", + "enquirer": "^2.3.0", + "env-paths": "^2.2.0", + "ethereum-cryptography": "^1.0.3", + "ethereumjs-abi": "^0.6.8", + "find-up": "^2.1.0", + "fp-ts": "1.19.3", + "fs-extra": "^7.0.1", + "glob": "7.2.0", + "immutable": "^4.0.0-rc.12", + "io-ts": "1.10.4", + "keccak": "^3.0.2", + "lodash": "^4.17.11", + "mnemonist": "^0.38.0", + "mocha": "^10.0.0", + "p-map": "^4.0.0", + "raw-body": "^2.4.1", + "resolve": "1.17.0", + "semver": "^6.3.0", + "solc": "0.8.26", + "source-map-support": "^0.5.13", + "stacktrace-parser": "^0.1.10", + "tsort": "0.0.1", + "undici": "^5.14.0", + "uuid": "^8.3.2", + "ws": "^7.4.6" + }, + "bin": { + "hardhat": "internal/cli/bootstrap.js" + }, + "peerDependencies": { + "ts-node": "*", + "typescript": "*" + }, + "peerDependenciesMeta": { + "ts-node": { + "optional": true + }, + "typescript": { + "optional": true + } + } + }, + "node_modules/hardhat-gas-reporter": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/hardhat-gas-reporter/-/hardhat-gas-reporter-1.0.10.tgz", + "integrity": "sha512-02N4+So/fZrzJ88ci54GqwVA3Zrf0C9duuTyGt0CFRIh/CdNwbnTgkXkRfojOMLBQ+6t+lBIkgbsOtqMvNwikA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-uniq": "1.0.3", + "eth-gas-reporter": "^0.2.25", + "sha1": "^1.1.1" + }, + "peerDependencies": { + "hardhat": "^2.0.2" + } + }, + "node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hash-base": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", + "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.4", + "readable-stream": "^3.6.0", + "safe-buffer": "^5.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/hash.js": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.1" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/he": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", + "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/heap": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/heap/-/heap-0.2.7.tgz", + "integrity": "sha512-2bsegYkkHO+h/9MGbn6KWcE45cHZgPANo5LXF7EvWdT0yT2EguSVO1nDgU5c8+ZOPwp2vMNa7YFsJhVcDR9Sdg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/hmac-drbg": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", + "dev": true, + "license": "MIT", + "dependencies": { + "hash.js": "^1.0.3", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.1" + } + }, + "node_modules/http-basic": { + "version": "8.1.3", + "resolved": "https://registry.npmjs.org/http-basic/-/http-basic-8.1.3.tgz", + "integrity": "sha512-/EcDMwJZh3mABI2NhGfHOGOeOZITqfkEO4p/xK+l3NpyncIHUQBoMvCSF/b5GqvKtySC2srL/GGG3+EtlqlmCw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "caseless": "^0.12.0", + "concat-stream": "^1.6.2", + "http-response-object": "^3.0.1", + "parse-cache-control": "^1.0.1" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-response-object": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/http-response-object/-/http-response-object-3.0.2.tgz", + "integrity": "sha512-bqX0XTF6fnXSQcEJ2Iuyr75yVakyjIDCqroJQ/aHfSdlM743Cwqoi2nDYMzLGWUcuTWGWy8AAvOKXTfiv6q9RA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/node": "^10.0.3" + } + }, + "node_modules/http-response-object/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "dev": true, + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ignore": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz", + "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immer": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/immer/-/immer-10.0.2.tgz", + "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" + } + }, + "node_modules/immutable": { + "version": "4.3.7", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-4.3.7.tgz", + "integrity": "sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw==", + "dev": true, + "license": "MIT" + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/interpret": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/io-ts": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/io-ts/-/io-ts-1.10.4.tgz", + "integrity": "sha512-b23PteSnYXSONJ6JQXRAlvJhuw8KOtkqa87W4wDtvMrud/DTJd5X+NpOOI+O/zZwVq6v0VLAaJ+1EDViKEuN9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "fp-ts": "^1.0.0" + } + }, + "node_modules/is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "license": "MIT", + "dependencies": { + "binary-extensions": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-hex-prefixed": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha512-WvtOiug1VFrE9v1Cydwm+FnXd3+w9GaeVUss5W4v/SLy3UW00vP+6iNF2SdnfiBoLy4bTqVdkftNGTUeOFVsbA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-obj": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", + "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==", + "dev": true, + "license": "MIT", + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsonschema": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsonschema/-/jsonschema-1.4.1.tgz", + "integrity": "sha512-S6cATIPVv1z0IlxdN+zUk5EPjkGCdnhN4wVSBlvoUO1tOLJootbo9CquNJmbIh4yikWHiUedhRYrNPn1arpEmQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/keccak": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", + "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/kleur": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha512-TwuEnCnxbc3rAvhf/LbG7tJUDzhqXyFnv3dtzLOPgCG/hODL7WFnsbwktkD7yUV0RrreP/l1PALq/YSg6VvjlA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/lodash.truncate": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", + "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-symbols/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/log-symbols/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/log-symbols/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/log-symbols/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/loupe": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", + "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-func-name": "^2.0.1" + } + }, + "node_modules/lru_map": { + "version": "0.3.3", + "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", + "integrity": "sha512-Pn9cox5CsMYngeDbmChANltQl+5pi6XmTrraMSzhPmMBbmgcxmqWry0U3PGapCU1yB4/LqCcom7qhHZiF/jGfQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/make-error": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", + "dev": true, + "license": "ISC", + "peer": true + }, + "node_modules/markdown-table": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-1.1.3.tgz", + "integrity": "sha512-1RUZVgQlpJSPWYbFSpmudq5nHY1doEIv89gBtF0s4gW1GF2XorxcA/70M5vq7rLv0a6mhOUccRsqkwhwLCIQ2Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/md5.js": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1", + "safe-buffer": "^5.1.2" + } + }, + "node_modules/memorystream": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", + "integrity": "sha512-S3UwM3yj5mtUSEfP41UZmt/0SCoVYUcU1rkXv+BQ5Ig8ndL4sPoJNBUJERafdPb5jjHJGuMgytgKvKIf58XNBw==", + "dev": true, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/micro-ftch": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", + "integrity": "sha512-/0LLxhzP0tfiR5hcQebtudP56gUurs2CLkGarnCiB/OqEyUFQ6U3paQi/tgLv0hBJYt2rnr9MNpxz4fiiugstg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimalistic-assert": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==", + "dev": true, + "license": "ISC" + }, + "node_modules/minimalistic-crypto-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==", + "dev": true, + "license": "MIT" + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "peer": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/mkdirp": { + "version": "0.5.6", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", + "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mnemonist": { + "version": "0.38.5", + "resolved": "https://registry.npmjs.org/mnemonist/-/mnemonist-0.38.5.tgz", + "integrity": "sha512-bZTFT5rrPKtPJxj8KSV0WkPyNxl72vQepqqVUAW2ARUpUSF2qXMB6jZj7hW5/k7C1rtpzqbD/IIbJwLXUjCHeg==", + "dev": true, + "license": "MIT", + "dependencies": { + "obliterator": "^2.0.0" + } + }, + "node_modules/mocha": { + "version": "10.7.3", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", + "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.3", + "browser-stdout": "^1.3.1", + "chokidar": "^3.5.3", + "debug": "^4.3.5", + "diff": "^5.2.0", + "escape-string-regexp": "^4.0.0", + "find-up": "^5.0.0", + "glob": "^8.1.0", + "he": "^1.2.0", + "js-yaml": "^4.1.0", + "log-symbols": "^4.1.0", + "minimatch": "^5.1.6", + "ms": "^2.1.3", + "serialize-javascript": "^6.0.2", + "strip-json-comments": "^3.1.1", + "supports-color": "^8.1.1", + "workerpool": "^6.5.1", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9", + "yargs-unparser": "^2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + } + }, + "node_modules/mocha/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/mocha/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/mocha/node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/ndjson": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz", + "integrity": "sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "json-stringify-safe": "^5.0.1", + "minimist": "^1.2.5", + "readable-stream": "^3.6.0", + "split2": "^3.0.0", + "through2": "^4.0.0" + }, + "bin": { + "ndjson": "cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/neo-async": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/node-addon-api": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", + "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==", + "dev": true, + "license": "MIT" + }, + "node_modules/node-emoji": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/node-emoji/-/node-emoji-1.11.0.tgz", + "integrity": "sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "lodash": "^4.17.21" + } + }, + "node_modules/node-gyp-build": { + "version": "4.8.2", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", + "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", + "dev": true, + "license": "MIT", + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/nofilter": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/nofilter/-/nofilter-3.1.0.tgz", + "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=12.19" + } + }, + "node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha512-4GUt3kSEYmk4ITxzB/b9vaIDfUVWN/Ml1Fwl11IlnIG2iaJ9O6WXZ9SrYM9NLI8OCBieN2Y8SWC2oJV0RQ7qYg==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/number-to-bn": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/number-to-bn/-/number-to-bn-1.7.0.tgz", + "integrity": "sha512-wsJ9gfSz1/s4ZsJN01lyonwuxA1tml6X1yBDnfpMglypcBRFZZkus26EdPSlqS5GJfYddVZa22p3VNb3z5m5Ig==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "bn.js": "4.11.6", + "strip-hex-prefix": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/number-to-bn/node_modules/bn.js": { + "version": "4.11.6", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.6.tgz", + "integrity": "sha512-XWwnNNFCuuSQ0m3r3C4LE3EiORltHd9M05pq6FOlVeiophzRbMo50Sbz1ehl8K3Z+jw9+vmgnXefY1hz8X+2wA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/obliterator": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/obliterator/-/obliterator-2.0.4.tgz", + "integrity": "sha512-lgHwxlxV1qIg1Eap7LgIeoBWIMFibOjbrYPIPJZcI1mmGAI2m3lNYpK12Y+GBdPQ0U1hRwSord7GIaawz962qQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ordinal": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/ordinal/-/ordinal-1.0.3.tgz", + "integrity": "sha512-cMddMgb2QElm8G7vdaa02jhUNbTSrhsgAGUz1OokD83uJTwSUn+nKoNoKVVaRa08yF6sgfO7Maou1+bgLd9rdQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^1.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^1.1.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/parse-cache-control": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parse-cache-control/-/parse-cache-control-1.0.1.tgz", + "integrity": "sha512-60zvsJReQPX5/QP0Kzfd/VrpjScIQ7SHBW6bFCYfEP+fp0Eppr1SHhIO5nd1PjZtvclzSzES9D/p5nFJurwfWg==", + "dev": true, + "peer": true + }, + "node_modules/path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-parse": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", + "dev": true, + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/pathval": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", + "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/pbkdf2": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", + "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", + "dev": true, + "license": "MIT", + "dependencies": { + "create-hash": "^1.1.2", + "create-hmac": "^1.1.4", + "ripemd160": "^2.0.1", + "safe-buffer": "^5.0.1", + "sha.js": "^2.4.8" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "dev": true, + "peer": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/prettier": { + "version": "2.8.8", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", + "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "prettier": "bin-prettier.js" + }, + "engines": { + "node": ">=10.13.0" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/promise": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/promise/-/promise-8.3.0.tgz", + "integrity": "sha512-rZPNPKTOYVNEEKFaq1HqTgOwZD+4/YHS5ukLzQCypkj+OkYx7iv0mA91lJlpPPZ8vMau3IIGj5Qlwrx+8iiSmg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asap": "~2.0.6" + } + }, + "node_modules/prompts": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.4.2.tgz", + "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "kleur": "^3.0.3", + "sisteransi": "^1.0.5" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/qs": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", + "integrity": "sha512-+38qI9SOr8tfZ4QmJNplMUxqjbe7LKvvZgWdExBOmd+egZTtjLB67Gu0HRX3u/XOq7UU2Nx6nsjvS16Z9uwfpg==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "side-channel": "^1.0.6" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "peer": true + }, + "node_modules/randombytes": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", + "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "dev": true, + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "dev": true, + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/readdirp": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", + "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" + } + }, + "node_modules/rechoir": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", + "integrity": "sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==", + "dev": true, + "peer": true, + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/recursive-readdir": { + "version": "2.2.3", + "resolved": "https://registry.npmjs.org/recursive-readdir/-/recursive-readdir-2.2.3.tgz", + "integrity": "sha512-8HrF5ZsXk5FAH9dgsx3BlUer73nIhuj+9OrQwEbLTPOBzGkL1lsFCR01am+v+0m2Cmbs1nP12hLDl5FA7EszKA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/req-cwd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-cwd/-/req-cwd-2.0.0.tgz", + "integrity": "sha512-ueoIoLo1OfB6b05COxAA9UpeoscNpYyM+BqYlA7H6LVF4hKGPXQQSSaD2YmvDVJMkk4UDpAHIeU1zG53IqjvlQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "req-from": "^2.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/req-from": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/req-from/-/req-from-2.0.0.tgz", + "integrity": "sha512-LzTfEVDVQHBRfjOUMgNBA+V6DWsSnoeKzf42J7l0xa/B4jyPOuuF5MlNSmomLNGemWTnV2TIdjSSLnEn95fOQA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "resolve-from": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/require-from-string": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/require-from-string/-/require-from-string-2.0.2.tgz", + "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/resolve-from": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz", + "integrity": "sha512-GnlH6vxLymXJNMBo7XP1fJIzBFbdYt49CuTwmB/6N53t+kMPRMFKz783LlQ4tv28XoQfMWinAJX6WCGf2IlaIw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/ripemd160": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "hash-base": "^3.0.0", + "inherits": "^2.0.1" + } + }, + "node_modules/rlp": { + "version": "2.2.7", + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", + "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", + "dev": true, + "license": "MPL-2.0", + "dependencies": { + "bn.js": "^5.2.0" + }, + "bin": { + "rlp": "bin/rlp" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "peer": true, + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/sc-istanbul": { + "version": "0.4.6", + "resolved": "https://registry.npmjs.org/sc-istanbul/-/sc-istanbul-0.4.6.tgz", + "integrity": "sha512-qJFF/8tW/zJsbyfh/iT/ZM5QNHE3CXxtLJbZsL+CzdJLBsPD7SedJZoUA4d8iAcN2IoMp/Dx80shOOd2x96X/g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "abbrev": "1.0.x", + "async": "1.x", + "escodegen": "1.8.x", + "esprima": "2.7.x", + "glob": "^5.0.15", + "handlebars": "^4.0.1", + "js-yaml": "3.x", + "mkdirp": "0.5.x", + "nopt": "3.x", + "once": "1.x", + "resolve": "1.1.x", + "supports-color": "^3.1.0", + "which": "^1.1.1", + "wordwrap": "^1.0.0" + }, + "bin": { + "istanbul": "lib/cli.js" + } + }, + "node_modules/sc-istanbul/node_modules/argparse": { + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "sprintf-js": "~1.0.2" + } + }, + "node_modules/sc-istanbul/node_modules/glob": { + "version": "5.0.15", + "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", + "integrity": "sha512-c9IPMazfRITpmAAKi22dK1VKxGDX9ehhqfABDriL/lzO92xcUKEJPQHrVA/2YHSNFB4iFlykVmWvwo48nr3OxA==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/sc-istanbul/node_modules/has-flag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-1.0.0.tgz", + "integrity": "sha512-DyYHfIYwAJmjAjSSPKANxI8bFY9YtFrgkAfinBojQ8YJTOuOuav64tMUJv584SES4xl74PmuaevIyaLESHdTAA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml": { + "version": "3.14.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", + "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/sc-istanbul/node_modules/js-yaml/node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "peer": true, + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/sc-istanbul/node_modules/resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha512-9znBF0vBcaSN3W2j7wKvdERPwqTxSpCq+if5C0WoTCyV9n24rua28jeuQ2pL/HOf+yUe/Mef+H/5p60K0Id3bg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/sc-istanbul/node_modules/supports-color": { + "version": "3.2.3", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.2.3.tgz", + "integrity": "sha512-Jds2VIYDrlp5ui7t8abHN2bjAu4LV/q4N2KivFPpGH0lrka0BMq/33AmECUXlKPcHigkNaqfXRENFju+rlcy+A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^1.0.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/scrypt-js": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", + "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", + "dev": true, + "license": "MIT" + }, + "node_modules/secp256k1": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.3.tgz", + "integrity": "sha512-NLZVf+ROMxwtEj3Xa562qgv2BK5e2WNmXPiOdVIPLgs6lyTzMvBq0aWTYMI5XCP9jZMVKOcqZLw/Wc4vDkuxhA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "elliptic": "^6.5.4", + "node-addon-api": "^2.0.0", + "node-gyp-build": "^4.2.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/semver": { + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", + "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + } + }, + "node_modules/serialize-javascript": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", + "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setimmediate": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==", + "dev": true, + "license": "MIT" + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "dev": true, + "license": "ISC" + }, + "node_modules/sha.js": { + "version": "2.4.11", + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "dev": true, + "license": "(MIT AND BSD-3-Clause)", + "dependencies": { + "inherits": "^2.0.1", + "safe-buffer": "^5.0.1" + }, + "bin": { + "sha.js": "bin.js" + } + }, + "node_modules/sha1": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/sha1/-/sha1-1.1.1.tgz", + "integrity": "sha512-dZBS6OrMjtgVkopB1Gmo4RQCDKiZsqcpAQpkV/aaj+FCrCg8r4I4qMkDPQjBgLIxlmu9k4nUbWq6ohXahOneYA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "charenc": ">= 0.0.1", + "crypt": ">= 0.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/shelljs": { + "version": "0.8.5", + "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.5.tgz", + "integrity": "sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sisteransi": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", + "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/slice-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/slice-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/solc": { + "version": "0.8.26", + "resolved": "https://registry.npmjs.org/solc/-/solc-0.8.26.tgz", + "integrity": "sha512-yiPQNVf5rBFHwN6SIf3TUUvVAFKcQqmSUFeq+fb6pNRCo0ZCgpYOZDi3BVoezCPIAcKrVYd/qXlBLUP9wVrZ9g==", + "dev": true, + "license": "MIT", + "dependencies": { + "command-exists": "^1.2.8", + "commander": "^8.1.0", + "follow-redirects": "^1.12.1", + "js-sha3": "0.8.0", + "memorystream": "^0.3.1", + "semver": "^5.5.0", + "tmp": "0.0.33" + }, + "bin": { + "solcjs": "solc.js" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/solc/node_modules/semver": { + "version": "5.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", + "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/solidity-coverage": { + "version": "0.8.13", + "resolved": "https://registry.npmjs.org/solidity-coverage/-/solidity-coverage-0.8.13.tgz", + "integrity": "sha512-RiBoI+kF94V3Rv0+iwOj3HQVSqNzA9qm/qDP1ZDXK5IX0Cvho1qiz8hAXTsAo6KOIUeP73jfscq0KlLqVxzGWA==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "@ethersproject/abi": "^5.0.9", + "@solidity-parser/parser": "^0.18.0", + "chalk": "^2.4.2", + "death": "^1.1.0", + "difflib": "^0.2.4", + "fs-extra": "^8.1.0", + "ghost-testrpc": "^0.0.2", + "global-modules": "^2.0.0", + "globby": "^10.0.1", + "jsonschema": "^1.2.4", + "lodash": "^4.17.21", + "mocha": "^10.2.0", + "node-emoji": "^1.10.0", + "pify": "^4.0.1", + "recursive-readdir": "^2.2.2", + "sc-istanbul": "^0.4.5", + "semver": "^7.3.4", + "shelljs": "^0.8.3", + "web3-utils": "^1.3.6" + }, + "bin": { + "solidity-coverage": "plugins/bin.js" + }, + "peerDependencies": { + "hardhat": "^2.11.0" + } + }, + "node_modules/solidity-coverage/node_modules/@solidity-parser/parser": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/@solidity-parser/parser/-/parser-0.18.0.tgz", + "integrity": "sha512-yfORGUIPgLck41qyN7nbwJRAx17/jAIXCTanHOJZhB6PJ1iAk/84b/xlsVKFSyNyLXIj0dhppoE0+CRws7wlzA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/solidity-coverage/node_modules/fs-extra": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, + "node_modules/solidity-coverage/node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "dev": true, + "license": "ISC", + "peer": true, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "node_modules/split2": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/split2/-/split2-3.2.2.tgz", + "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "readable-stream": "^3.0.0" + } + }, + "node_modules/sprintf-js": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", + "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true + }, + "node_modules/stacktrace-parser": { + "version": "0.1.10", + "resolved": "https://registry.npmjs.org/stacktrace-parser/-/stacktrace-parser-0.1.10.tgz", + "integrity": "sha512-KJP1OCML99+8fhOHxwwzyWrlUuVX5GQ0ZpJTd1DFXhdkrvg1szxfHhawXUZ3g9TkXORQd4/WG68jMlQZ2p8wlg==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.7.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/stacktrace-parser/node_modules/type-fest": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.7.1.tgz", + "integrity": "sha512-Ne2YiiGN8bmrmJJEuTWTLJR32nh/JdL1+PSicowtNb0WFpn59GK8/lfD61bVtzguz7b3PBt74nxpv/Pw5po5Rg==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-format": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/string-format/-/string-format-2.0.0.tgz", + "integrity": "sha512-bbEs3scLeYNXLecRRuk6uJxdXUSj6le/8rNPHChIJTn2V79aXVTR1EH2OH5zLKKoz0V02fOUKZZcw01pLUShZA==", + "dev": true, + "license": "WTFPL OR MIT", + "peer": true + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-hex-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha512-q8d4ue7JGEiVcypji1bALTos+0pWtyGlivAWyPuTkHzuTCJqrK9sWxYQZUq6Nq3cuyv3bm734IhHvHtGGURU6A==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-hex-prefixed": "1.0.0" + }, + "engines": { + "node": ">=6.5.0", + "npm": ">=3" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/sync-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/sync-request/-/sync-request-6.1.0.tgz", + "integrity": "sha512-8fjNkrNlNCrVc/av+Jn+xxqfCjYaBoHqCsDz6mt030UMxJGr+GSfCV1dQt2gRtlL63+VPidwDVLr7V2OcTSdRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "http-response-object": "^3.0.1", + "sync-rpc": "^1.2.1", + "then-request": "^6.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/sync-rpc": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/sync-rpc/-/sync-rpc-1.3.6.tgz", + "integrity": "sha512-J8jTXuZzRlvU7HemDgHi3pGnh/rkoqR/OZSjhTyyZrEkkYQbk7Z33AXp37mkPfPpfdOuj7Ex3H/TJM1z48uPQw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "get-port": "^3.1.0" + } + }, + "node_modules/table": { + "version": "6.8.2", + "resolved": "https://registry.npmjs.org/table/-/table-6.8.2.tgz", + "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "dependencies": { + "ajv": "^8.0.1", + "lodash.truncate": "^4.4.2", + "slice-ansi": "^4.0.0", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/table-layout": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/table-layout/-/table-layout-1.0.2.tgz", + "integrity": "sha512-qd/R7n5rQTRFi+Zf2sk5XVVd9UQl6ZkduPFC3S7WEGJAmetDTjY3qPN50eSKzwuzEyQKy5TN2TiZdkIjos2L6A==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "array-back": "^4.0.1", + "deep-extend": "~0.6.0", + "typical": "^5.2.0", + "wordwrapjs": "^4.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/table-layout/node_modules/array-back": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-4.0.2.tgz", + "integrity": "sha512-NbdMezxqf94cnNfWLL7V/im0Ub+Anbb0IoZhvzie8+4HJ4nMQuzHuy49FkGYCJK2yAloZ3meiB6AVMClbrI1vg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/table-layout/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/then-request": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/then-request/-/then-request-6.0.2.tgz", + "integrity": "sha512-3ZBiG7JvP3wbDzA9iNY5zJQcHL4jn/0BWtXIkagfz7QgOL/LqjCEOBQuJNZfu0XYnv5JhKh+cDxCPM4ILrqruA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/concat-stream": "^1.6.0", + "@types/form-data": "0.0.33", + "@types/node": "^8.0.0", + "@types/qs": "^6.2.31", + "caseless": "~0.12.0", + "concat-stream": "^1.6.0", + "form-data": "^2.2.0", + "http-basic": "^8.1.1", + "http-response-object": "^3.0.1", + "promise": "^8.0.0", + "qs": "^6.4.0" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/then-request/node_modules/@types/node": { + "version": "8.10.66", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", + "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/then-request/node_modules/form-data": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.5.1.tgz", + "integrity": "sha512-m21N3WOmEEURgk6B9GLOE4RuWOFf28Lhh9qGYeNlGq4VDXUlJy2th2slBNU8Gp8EzloYZOibZJ7t5ecIrFSjVA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/through2": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", + "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "readable-stream": "3" + } + }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/ts-command-line-args": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/ts-command-line-args/-/ts-command-line-args-2.5.1.tgz", + "integrity": "sha512-H69ZwTw3rFHb5WYpQya40YAX2/w7Ut75uUECbgBIsLmM+BNuYnxsltfyyLMxy6sEeKxgijLTnQtLd0nKd6+IYw==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "chalk": "^4.1.0", + "command-line-args": "^5.1.1", + "command-line-usage": "^6.1.0", + "string-format": "^2.0.0" + }, + "bin": { + "write-markdown": "dist/write-markdown.js" + } + }, + "node_modules/ts-command-line-args/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/ts-command-line-args/node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/ts-command-line-args/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/ts-command-line-args/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/ts-command-line-args/node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-command-line-args/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ts-essentials": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/ts-essentials/-/ts-essentials-7.0.3.tgz", + "integrity": "sha512-8+gr5+lqO3G84KdiTSMRLtuyJ+nTBVRKuCrK4lidMPdVeEp0uqC875uE5NMcaA7YYMN7XsNiFQuMvasF8HT/xQ==", + "dev": true, + "license": "MIT", + "peer": true, + "peerDependencies": { + "typescript": ">=3.7.0" + } + }, + "node_modules/ts-node": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.2.tgz", + "integrity": "sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } + } + }, + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "license": "BSD-3-Clause", + "peer": true, + "engines": { + "node": ">=0.3.1" + } + }, + "node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tsort": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/tsort/-/tsort-0.0.1.tgz", + "integrity": "sha512-Tyrf5mxF8Ofs1tNoxA13lFeZ2Zrbd6cKbuH3V+MQ5sb6DtBj5FjrXVsRWT8YvNAQTqNoz66dz1WsbigI22aEnw==", + "dev": true, + "license": "MIT" + }, + "node_modules/tweetnacl": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", + "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/tweetnacl-util": { + "version": "0.15.1", + "resolved": "https://registry.npmjs.org/tweetnacl-util/-/tweetnacl-util-0.15.1.tgz", + "integrity": "sha512-RKJBIj8lySrShN4w6i/BonWp2Z/uxwC3h4y7xsRrpP59ZboCd0GpEVsOnMDYLMmKBpYhb5TgHzZXy7wTfYFBRw==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-detect": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", + "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/typechain": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/typechain/-/typechain-8.3.2.tgz", + "integrity": "sha512-x/sQYr5w9K7yv3es7jo4KTX05CLxOf7TRWwoHlrjRh8H82G64g+k7VuWPJlgMo6qrjfCulOdfBjiaDtmhFYD/Q==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@types/prettier": "^2.1.1", + "debug": "^4.3.1", + "fs-extra": "^7.0.0", + "glob": "7.1.7", + "js-sha3": "^0.8.0", + "lodash": "^4.17.15", + "mkdirp": "^1.0.4", + "prettier": "^2.3.1", + "ts-command-line-args": "^2.2.0", + "ts-essentials": "^7.0.1" + }, + "bin": { + "typechain": "dist/cli/cli.js" + }, + "peerDependencies": { + "typescript": ">=4.3.0" + } + }, + "node_modules/typechain/node_modules/glob": { + "version": "7.1.7", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.7.tgz", + "integrity": "sha512-OvD9ENzPLbegENnYP5UUfJIirTg4+XwMWGaQfQTY0JenxNvvIKP3U3/tAQSPIu/lHxXYSZmpXlUHeqAIdKzBLQ==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/typechain/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "dev": true, + "license": "MIT", + "peer": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/typescript": { + "version": "5.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.5.4.tgz", + "integrity": "sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==", + "dev": true, + "license": "Apache-2.0", + "peer": true, + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/uglify-js": { + "version": "3.19.3", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.19.3.tgz", + "integrity": "sha512-v3Xu+yuwBXisp6QYTcH4UbH+xYJXqnq2m/LtQVWKWzYc1iehYnLixoQDN9FH6/j9/oybfd6W9Ghwkl8+UMKTKQ==", + "dev": true, + "license": "BSD-2-Clause", + "optional": true, + "peer": true, + "bin": { + "uglifyjs": "bin/uglifyjs" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/undici": { + "version": "5.28.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz", + "integrity": "sha512-72RFADWFqKmUb2hmmvNODKL3p9hcB6Gt2DOQMis1SEBaV6a4MH8soBvzg+95CYhCKPFedut2JY9bMfrDl9D23g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "dev": true, + "license": "MIT" + }, + "node_modules/universalify": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "dev": true, + "license": "MIT" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", + "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/web3-utils": { + "version": "1.10.4", + "resolved": "https://registry.npmjs.org/web3-utils/-/web3-utils-1.10.4.tgz", + "integrity": "sha512-tsu8FiKJLk2PzhDl9fXbGUWTkkVXYhtTA+SmEFkKft+9BgwLxfCRpU96sWv7ICC8zixBNd3JURVoiR3dUXgP8A==", + "dev": true, + "license": "LGPL-3.0", + "peer": true, + "dependencies": { + "@ethereumjs/util": "^8.1.0", + "bn.js": "^5.2.1", + "ethereum-bloom-filters": "^1.0.6", + "ethereum-cryptography": "^2.1.2", + "ethjs-unit": "0.1.6", + "number-to-bn": "1.7.0", + "randombytes": "^2.1.0", + "utf8": "3.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/web3-utils/node_modules/@noble/curves": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.4.2.tgz", + "integrity": "sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "1.4.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@noble/hashes": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", + "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">= 16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip32": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.4.0.tgz", + "integrity": "sha512-sVUpc0Vq3tXCkDGYVWGIZTRfnvu8LoTDaev7vbwh0omSvVORONr960MQWdKqJDCReIEmTj3PAr73O3aoxz7OPg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "~1.4.0", + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/@scure/bip39": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.3.0.tgz", + "integrity": "sha512-disdg7gHuTDZtY+ZdkmLpPCk7fxZSu3gBiEGuoC1XYxv9cGx3Z6cpTggCgW6odSOOIXCiDjuGejW+aJKCY/pIQ==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/hashes": "~1.4.0", + "@scure/base": "~1.1.6" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/web3-utils/node_modules/ethereum-cryptography": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-2.2.1.tgz", + "integrity": "sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "@noble/curves": "1.4.2", + "@noble/hashes": "1.4.0", + "@scure/bip32": "1.4.0", + "@scure/bip39": "1.3.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "license": "ISC", + "peer": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/widest-line": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-3.1.0.tgz", + "integrity": "sha512-NsmoXalsWVDMGupxZ5R08ka9flZjjiLvHVAWYOKtiKM8ujtZWr9cRffak+uSE48+Ob8ObalXpwyeUiyDD6QFgg==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==", + "dev": true, + "license": "MIT", + "peer": true + }, + "node_modules/wordwrapjs": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/wordwrapjs/-/wordwrapjs-4.0.1.tgz", + "integrity": "sha512-kKlNACbvHrkpIw6oPeYDSmdCTu2hdMHoyXLTcUKala++lx5Y+wjJ/e474Jqv5abnVmwxw08DiTuHmw69lJGksA==", + "dev": true, + "license": "MIT", + "peer": true, + "dependencies": { + "reduce-flatten": "^2.0.0", + "typical": "^5.2.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/wordwrapjs/node_modules/typical": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-5.2.0.tgz", + "integrity": "sha512-dvdQgNDNJo+8B2uBQoqdb11eUCE1JQXhvjC/CZtgvZseVd5TYMXnq0+vuUemXbd/Se29cTaUuPX3YIc2xgbvIg==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/workerpool": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", + "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/wrap-ansi/node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/wrap-ansi/node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs": { + "version": "16.2.0", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", + "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-parser": { + "version": "20.2.9", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", + "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", + "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "dev": true, + "license": "MIT", + "dependencies": { + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/yn": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "dev": true, + "license": "MIT", + "peer": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + } +} diff --git a/scripts/test-contracts/package.json b/scripts/test-contracts/package.json new file mode 100644 index 000000000..ac59de4d0 --- /dev/null +++ b/scripts/test-contracts/package.json @@ -0,0 +1,18 @@ +{ + "name": "test-contract", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "description": "", + "devDependencies": { + "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "hardhat": "^2.22.10" + }, + "dependencies": { + "@openzeppelin/contracts": "^5.0.2" + } +} diff --git a/traits/src/evm.rs b/traits/src/evm.rs index 8dc1ea184..9c087628c 100644 --- a/traits/src/evm.rs +++ b/traits/src/evm.rs @@ -1,4 +1,8 @@ -pub trait InspectEvmAccounts { +use codec::{Decode, Encode}; +use frame_support::sp_runtime::app_crypto::sp_core::{H160, U256}; +use frame_support::sp_runtime::{DispatchResult, RuntimeDebug}; + +pub trait InspectEvmAccounts { /// Returns `True` if the account is EVM truncated account. fn is_evm_account(account_id: AccountId) -> bool; @@ -17,4 +21,56 @@ pub trait InspectEvmAccounts { /// Returns `True` if the address is allowed to deploy smart contracts. fn can_deploy_contracts(evm_address: EvmAddress) -> bool; + + /// Returns `True` if the address is allowed to manage balances and tokens. + fn is_approved_contract(address: EvmAddress) -> bool; +} + +pub type EvmAddress = H160; + +#[derive(Encode, Decode, Eq, PartialEq, Copy, Clone, RuntimeDebug)] +pub struct CallContext { + pub contract: EvmAddress, + /// msg.sender + pub sender: EvmAddress, + /// tx.origin + pub origin: EvmAddress, +} + +impl CallContext { + pub fn new(contract: EvmAddress, sender: EvmAddress, origin: EvmAddress) -> Self { + Self { + contract, + sender, + origin, + } + } + + pub fn new_view(contract: EvmAddress) -> Self { + Self { + contract, + sender: EvmAddress::default(), + origin: EvmAddress::default(), + } + } +} + +pub trait EVM { + fn call(context: CallContext, data: Vec, value: U256, gas: u64) -> EvmResult; + fn view(context: CallContext, data: Vec, gas: u64) -> EvmResult; +} + +/// ERC20 interface adapter +pub trait ERC20 { + type Balance; + + fn name(context: CallContext) -> Option>; + fn symbol(context: CallContext) -> Option>; + fn decimals(context: CallContext) -> Option; + fn total_supply(context: CallContext) -> Self::Balance; + fn balance_of(context: CallContext, address: EvmAddress) -> Self::Balance; + fn allowance(context: CallContext, owner: EvmAddress, spender: EvmAddress) -> Self::Balance; + fn approve(context: CallContext, spender: EvmAddress, value: Self::Balance) -> DispatchResult; + fn transfer(context: CallContext, to: EvmAddress, value: Self::Balance) -> DispatchResult; + fn transfer_from(context: CallContext, from: EvmAddress, to: EvmAddress, value: Self::Balance) -> DispatchResult; } diff --git a/traits/src/registry.rs b/traits/src/registry.rs index d5a39aa2c..137e765da 100644 --- a/traits/src/registry.rs +++ b/traits/src/registry.rs @@ -1,3 +1,5 @@ +use crate::evm::EvmAddress; +use frame_support::dispatch::Parameter; use sp_std::vec::Vec; #[derive(Eq, PartialEq, Copy, Clone, Debug)] @@ -7,6 +9,7 @@ pub enum AssetKind { StableSwap, Bond, External, + Erc20, } // Deprecated. @@ -27,8 +30,6 @@ pub trait AccountIdFor { fn name(assets: &Assets, identifier: Option<&[u8]>) -> Vec; } -use frame_support::dispatch::Parameter; - pub trait Inspect { type AssetId: Parameter; type Location: Parameter; @@ -174,3 +175,7 @@ pub trait Mutate: Inspect { /// Set location for existing asset id if it wasn't set yet. fn set_location(asset_id: Self::AssetId, location: Self::Location) -> Result<(), Self::Error>; } + +pub trait BoundErc20: Inspect { + fn contract_address(id: Self::AssetId) -> Option; +} From b2ccc1da9435df21140ae0c68ed9d1e542accf5e Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 4 Sep 2024 13:27:35 +0200 Subject: [PATCH 02/57] merge fix --- Cargo.lock | 2 -- 1 file changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f65b7b9b2..cd8e6c9ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11873,7 +11873,6 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", - "hex", "hex-literal 0.4.1", "hydradx-adapters", "hydradx-runtime", @@ -11941,7 +11940,6 @@ dependencies = [ "rococo-runtime", "sc-consensus-grandpa", "scraper", - "serde_json", "sp-api", "sp-authority-discovery", "sp-block-builder", From 47ae501a522e748b51a23942799eac3fa1952bbe Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 4 Sep 2024 23:39:18 +0200 Subject: [PATCH 03/57] test mock added --- integration-tests/src/evm.rs | 32 +++--- pallets/currencies/src/lib.rs | 101 +++++++++++++++- pallets/currencies/src/mock.rs | 108 +----------------- pallets/dca/src/tests/mock.rs | 4 +- pallets/duster/src/mock.rs | 4 +- pallets/dynamic-evm-fee/src/tests/mock.rs | 4 +- pallets/otc-settlements/src/mock.rs | 4 +- pallets/route-executor/src/tests/mock.rs | 4 +- pallets/transaction-multi-payment/src/mock.rs | 4 +- runtime/adapters/src/tests/mock.rs | 4 +- 10 files changed, 139 insertions(+), 130 deletions(-) diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index 31b6f1973..d514e947d 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -9,14 +9,14 @@ use frame_support::{assert_ok, dispatch::GetDispatchInfo, sp_runtime::codec::Enc use frame_system::RawOrigin; use hex_literal::hex; use hydradx_runtime::evm::precompiles::DISPATCH_ADDR; +use hydradx_runtime::evm::EvmAddress; use hydradx_runtime::evm::ExtendedAddressMapping; use hydradx_runtime::XYK; use hydradx_runtime::{ evm::precompiles::{ - handle::EvmDataWriter, - multicurrency::{Action, MultiCurrencyPrecompile}, - Address, Bytes, EvmAddress, HydraDXPrecompiles, + handle::EvmDataWriter, multicurrency::MultiCurrencyPrecompile, Address, Bytes, HydraDXPrecompiles, }, + evm::Function, AssetRegistry, Balances, CallFilter, Currencies, EVMAccounts, Omnipool, RuntimeCall, RuntimeOrigin, Tokens, TransactionPause, EVM, }; @@ -152,7 +152,7 @@ mod account_conversion { 100 * UNITS as i128, )); - let data = EvmDataWriter::new_with_selector(Action::BalanceOf) + let data = EvmDataWriter::new_with_selector(Function::BalanceOf) .write(Address::from(evm_address)) .build(); @@ -195,7 +195,7 @@ mod account_conversion { //Arrange let evm_address = EVMAccounts::evm_address(&Into::::into(ALICE)); - let data = EvmDataWriter::new_with_selector(Action::BalanceOf) + let data = EvmDataWriter::new_with_selector(Function::BalanceOf) .write(Address::from(evm_address)) .build(); @@ -547,7 +547,7 @@ mod currency_precompile { Hydra::execute_with(|| { //Arrange - let data = EvmDataWriter::new_with_selector(Action::Name).build(); + let data = EvmDataWriter::new_with_selector(Function::Name).build(); let mut handle = MockHandle { input: data, @@ -583,7 +583,7 @@ mod currency_precompile { Hydra::execute_with(|| { //Arrange - let data = EvmDataWriter::new_with_selector(Action::Name).build(); + let data = EvmDataWriter::new_with_selector(Function::Name).build(); let mut handle = MockHandle { input: data, @@ -616,7 +616,7 @@ mod currency_precompile { Hydra::execute_with(|| { //Arrange - let data = EvmDataWriter::new_with_selector(Action::Name).build(); + let data = EvmDataWriter::new_with_selector(Function::Name).build(); let mut handle = MockHandle { input: data, @@ -664,7 +664,7 @@ mod currency_precompile { ) .unwrap(); - let data = EvmDataWriter::new_with_selector(Action::Symbol).build(); + let data = EvmDataWriter::new_with_selector(Function::Symbol).build(); let mut handle = MockHandle { input: data, @@ -712,7 +712,7 @@ mod currency_precompile { ) .unwrap(); - let data = EvmDataWriter::new_with_selector(Action::Decimals).build(); + let data = EvmDataWriter::new_with_selector(Function::Decimals).build(); let mut handle = MockHandle { input: data, @@ -751,7 +751,7 @@ mod currency_precompile { Hydra::execute_with(|| { //Arrange - let data = EvmDataWriter::new_with_selector(Action::TotalSupply).build(); + let data = EvmDataWriter::new_with_selector(Function::TotalSupply).build(); let mut handle = MockHandle { input: data, @@ -797,7 +797,7 @@ mod currency_precompile { 100 * UNITS as i128, )); - let data = EvmDataWriter::new_with_selector(Action::BalanceOf) + let data = EvmDataWriter::new_with_selector(Function::BalanceOf) .write(Address::from(evm_address())) .build(); @@ -845,7 +845,7 @@ mod currency_precompile { 100 * UNITS as i128, )); - let data = EvmDataWriter::new_with_selector(Action::Transfer) + let data = EvmDataWriter::new_with_selector(Function::Transfer) .write(Address::from(evm_address2())) .write(U256::from(86u128 * UNITS)) .build(); @@ -883,7 +883,7 @@ mod currency_precompile { 100 * UNITS as i128, )); - let data = EvmDataWriter::new_with_selector(Action::Approve) + let data = EvmDataWriter::new_with_selector(Function::Approve) .write(Address::from(evm_address2())) .write(U256::from(50u128 * UNITS)) .build(); @@ -918,7 +918,7 @@ mod currency_precompile { Hydra::execute_with(|| { //Arrange - let data = EvmDataWriter::new_with_selector(Action::Allowance) + let data = EvmDataWriter::new_with_selector(Function::Allowance) .write(Address::from(evm_address())) .write(Address::from(evm_address2())) .build(); @@ -960,7 +960,7 @@ mod currency_precompile { 100 * UNITS as i128, )); - let data = EvmDataWriter::new_with_selector(Action::TransferFrom) + let data = EvmDataWriter::new_with_selector(Function::TransferFrom) .write(Address::from(evm_address())) .write(Address::from(evm_address2())) .write(U256::from(50u128 * UNITS)) diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index 31ac7fd1e..e230a9495 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -51,7 +51,7 @@ use frame_support::{ }; use frame_system::{ensure_root, ensure_signed, pallet_prelude::*}; use hydradx_traits::evm::EvmAddress; -use hydradx_traits::BoundErc20; +use hydradx_traits::{AssetKind, BoundErc20}; use orml_traits::{ arithmetic::{Signed, SimpleArithmetic}, currency::TransferAll, @@ -1028,3 +1028,102 @@ where >::done_transfer(source, dest, amount) } } + +pub struct MockErc20Currency(PhantomData); +impl MultiCurrency for MockErc20Currency { + type CurrencyId = EvmAddress; + type Balance = BalanceOf; + + fn minimum_balance(_currency_id: Self::CurrencyId) -> Self::Balance { + Default::default() + } + + fn total_issuance(_currency_id: Self::CurrencyId) -> Self::Balance { + Default::default() + } + + fn total_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { + Default::default() + } + + fn free_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { + Default::default() + } + + fn ensure_can_withdraw( + _currency_id: Self::CurrencyId, + _who: &T::AccountId, + _amount: Self::Balance, + ) -> DispatchResult { + Ok(()) + } + + fn transfer( + _currency_id: Self::CurrencyId, + _from: &T::AccountId, + _to: &T::AccountId, + _amount: Self::Balance, + ) -> DispatchResult { + Ok(()) + } + + fn deposit(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { + Ok(()) + } + + fn withdraw(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { + Ok(()) + } + + fn can_slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _value: Self::Balance) -> bool { + false + } + + fn slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> Self::Balance { + Default::default() + } +} + +pub struct MockBoundErc20(PhantomData); +impl hydradx_traits::Inspect for MockBoundErc20 { + type AssetId = CurrencyIdOf; + type Location = (); + + fn is_sufficient(_id: Self::AssetId) -> bool { + false + } + + fn exists(_id: Self::AssetId) -> bool { + false + } + + fn decimals(_id: Self::AssetId) -> Option { + None + } + + fn asset_type(_id: Self::AssetId) -> Option { + None + } + + fn is_banned(_id: Self::AssetId) -> bool { + false + } + + fn asset_name(_id: Self::AssetId) -> Option> { + None + } + + fn asset_symbol(_id: Self::AssetId) -> Option> { + None + } + + fn existential_deposit(_id: Self::AssetId) -> Option { + None + } +} + +impl BoundErc20 for MockBoundErc20 { + fn contract_address(_id: Self::AssetId) -> Option { + None + } +} diff --git a/pallets/currencies/src/mock.rs b/pallets/currencies/src/mock.rs index e7f299dff..3762cee1c 100644 --- a/pallets/currencies/src/mock.rs +++ b/pallets/currencies/src/mock.rs @@ -9,8 +9,6 @@ use frame_support::{ traits::{ConstU32, ConstU64, Everything, Nothing}, PalletId, }; -use hydradx_traits::evm::EvmAddress; -use hydradx_traits::AssetKind; use orml_traits::parameter_type_with_key; use sp_core::H256; use sp_runtime::{ @@ -103,116 +101,14 @@ impl Config for Runtime { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = AdaptedBasicCurrency; - type Erc20Currency = Erc20Currency; - type BoundErc20 = Runtime; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = GetNativeCurrencyId; type WeightInfo = (); } pub type NativeCurrency = NativeCurrencyOf; pub type AdaptedBasicCurrency = BasicCurrencyAdapter; -pub struct Erc20Currency(PhantomData); - -impl MultiCurrency for Erc20Currency -where - T::AccountId: AsRef<[u8; 32]> + IsType, -{ - type CurrencyId = EvmAddress; - type Balance = Balance; - - fn minimum_balance(_currency_id: Self::CurrencyId) -> Self::Balance { - todo!() - } - - fn total_issuance(_currency_id: Self::CurrencyId) -> Self::Balance { - todo!() - } - - fn total_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { - todo!() - } - - fn free_balance(_currency_id: Self::CurrencyId, _who: &T::AccountId) -> Self::Balance { - todo!() - } - - fn ensure_can_withdraw( - _currency_id: Self::CurrencyId, - _who: &T::AccountId, - _amount: Self::Balance, - ) -> DispatchResult { - todo!() - } - - fn transfer( - _currency_id: Self::CurrencyId, - _from: &T::AccountId, - _to: &T::AccountId, - _amount: Self::Balance, - ) -> DispatchResult { - todo!() - } - - fn deposit(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { - todo!() - } - - fn withdraw(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> DispatchResult { - todo!() - } - - fn can_slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _value: Self::Balance) -> bool { - todo!() - } - - fn slash(_currency_id: Self::CurrencyId, _who: &T::AccountId, _amount: Self::Balance) -> Self::Balance { - todo!() - } -} - -impl hydradx_traits::Inspect for Runtime { - type AssetId = CurrencyId; - type Location = (); - - fn is_sufficient(_id: Self::AssetId) -> bool { - todo!() - } - - fn exists(_id: Self::AssetId) -> bool { - todo!() - } - - fn decimals(_id: Self::AssetId) -> Option { - todo!() - } - - fn asset_type(_id: Self::AssetId) -> Option { - todo!() - } - - fn is_banned(_id: Self::AssetId) -> bool { - todo!() - } - - fn asset_name(_id: Self::AssetId) -> Option> { - todo!() - } - - fn asset_symbol(_id: Self::AssetId) -> Option> { - todo!() - } - - fn existential_deposit(_id: Self::AssetId) -> Option { - todo!() - } -} - -impl BoundErc20 for Runtime { - fn contract_address(_id: Self::AssetId) -> Option { - None - } -} - type Block = frame_system::mocking::MockBlock; construct_runtime!( diff --git a/pallets/dca/src/tests/mock.rs b/pallets/dca/src/tests/mock.rs index 2092d36aa..e182c3a6f 100644 --- a/pallets/dca/src/tests/mock.rs +++ b/pallets/dca/src/tests/mock.rs @@ -30,7 +30,7 @@ use frame_system as system; use frame_system::{ensure_signed, EnsureRoot}; use hydradx_traits::{registry::Inspect as InspectRegistry, AssetKind, NativePriceOracle, OraclePeriod, PriceOracle}; use orml_traits::{parameter_type_with_key, GetByKey}; -use pallet_currencies::BasicCurrencyAdapter; +use pallet_currencies::{BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use primitive_types::U128; use sp_core::H256; use sp_runtime::traits::{AccountIdConversion, BlockNumberProvider, ConstU32}; @@ -341,6 +341,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = NativeCurrencyId; type WeightInfo = (); } diff --git a/pallets/duster/src/mock.rs b/pallets/duster/src/mock.rs index 42d5638a7..d89e56ef2 100644 --- a/pallets/duster/src/mock.rs +++ b/pallets/duster/src/mock.rs @@ -4,7 +4,7 @@ use frame_support::parameter_types; use frame_support::traits::{Everything, Nothing, OnKilledAccount}; use orml_traits::parameter_type_with_key; -use pallet_currencies::BasicCurrencyAdapter; +use pallet_currencies::{BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use crate::Config; use frame_system as system; @@ -149,6 +149,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = NativeCurrencyId; type WeightInfo = (); } diff --git a/pallets/dynamic-evm-fee/src/tests/mock.rs b/pallets/dynamic-evm-fee/src/tests/mock.rs index a69655003..6bd7feb7a 100644 --- a/pallets/dynamic-evm-fee/src/tests/mock.rs +++ b/pallets/dynamic-evm-fee/src/tests/mock.rs @@ -29,7 +29,7 @@ use hydra_dx_math::ema::EmaPrice; use hydradx_traits::router::RouteProvider; use hydradx_traits::NativePriceOracle; use orml_traits::parameter_type_with_key; -use pallet_currencies::BasicCurrencyAdapter; +use pallet_currencies::{BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use pallet_transaction_payment::Multiplier; use sp_core::H256; use sp_runtime::{ @@ -222,6 +222,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = HdxAssetId; type WeightInfo = (); } diff --git a/pallets/otc-settlements/src/mock.rs b/pallets/otc-settlements/src/mock.rs index 0fb3789c9..5330cbb06 100644 --- a/pallets/otc-settlements/src/mock.rs +++ b/pallets/otc-settlements/src/mock.rs @@ -33,7 +33,7 @@ use hydradx_traits::{ OraclePeriod, PriceOracle, }; use orml_traits::{parameter_type_with_key, GetByKey}; -use pallet_currencies::{fungibles::FungibleCurrencies, BasicCurrencyAdapter}; +use pallet_currencies::{fungibles::FungibleCurrencies, BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use pallet_omnipool::traits::ExternalPriceProvider; use sp_core::offchain::{ testing::PoolState, testing::TestOffchainExt, testing::TestTransactionPoolExt, OffchainDbExt, OffchainWorkerExt, @@ -247,6 +247,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = HDXAssetId; type WeightInfo = (); } diff --git a/pallets/route-executor/src/tests/mock.rs b/pallets/route-executor/src/tests/mock.rs index 0363cf739..61bcb0677 100644 --- a/pallets/route-executor/src/tests/mock.rs +++ b/pallets/route-executor/src/tests/mock.rs @@ -26,7 +26,7 @@ use frame_system::{ensure_signed, pallet_prelude::OriginFor}; use hydra_dx_math::ratio::Ratio; use hydradx_traits::router::{ExecutorError, PoolType, RefundEdCalculator, TradeExecution}; use orml_traits::parameter_type_with_key; -use pallet_currencies::{fungibles::FungibleCurrencies, BasicCurrencyAdapter}; +use pallet_currencies::{fungibles::FungibleCurrencies, BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use pretty_assertions::assert_eq; use sp_core::H256; use sp_runtime::FixedU128; @@ -132,6 +132,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = NativeCurrencyId; type WeightInfo = (); } diff --git a/pallets/transaction-multi-payment/src/mock.rs b/pallets/transaction-multi-payment/src/mock.rs index 3692c0eec..b0af81c63 100644 --- a/pallets/transaction-multi-payment/src/mock.rs +++ b/pallets/transaction-multi-payment/src/mock.rs @@ -37,7 +37,7 @@ use hydradx_traits::{ AssetPairAccountIdFor, OraclePeriod, PriceOracle, }; use orml_traits::{currency::MutationHooks, parameter_type_with_key}; -use pallet_currencies::BasicCurrencyAdapter; +use pallet_currencies::{BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use sp_core::{H160, H256, U256}; use sp_std::cell::RefCell; @@ -273,6 +273,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = HdxAssetId; type WeightInfo = (); } diff --git a/runtime/adapters/src/tests/mock.rs b/runtime/adapters/src/tests/mock.rs index 149ef9140..cee52ca8b 100644 --- a/runtime/adapters/src/tests/mock.rs +++ b/runtime/adapters/src/tests/mock.rs @@ -39,7 +39,7 @@ use hydradx_traits::{ }; use orml_traits::{parameter_type_with_key, GetByKey}; use pallet_currencies::fungibles::FungibleCurrencies; -use pallet_currencies::BasicCurrencyAdapter; +use pallet_currencies::{BasicCurrencyAdapter, MockBoundErc20, MockErc20Currency}; use pallet_omnipool; use pallet_omnipool::traits::EnsurePriceWithin; use pallet_omnipool::traits::ExternalPriceProvider; @@ -225,6 +225,8 @@ impl pallet_currencies::Config for Test { type RuntimeEvent = RuntimeEvent; type MultiCurrency = Tokens; type NativeCurrency = BasicCurrencyAdapter; + type Erc20Currency = MockErc20Currency; + type BoundErc20 = MockBoundErc20; type GetNativeCurrencyId = NativeCurrencyId; type WeightInfo = (); } From 1ba1b11f2e367bfd5959deb3f5109980863de5e0 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 6 Sep 2024 03:54:06 +0200 Subject: [PATCH 04/57] integrations tests --- Cargo.lock | 4 + integration-tests/Cargo.toml | 4 + integration-tests/src/erc20.rs | 404 ++++++++++++++++++++++ integration-tests/src/evm.rs | 122 ++++++- integration-tests/src/lib.rs | 3 +- integration-tests/src/utils/contracts.rs | 50 +++ integration-tests/src/utils/mod.rs | 1 + runtime/hydradx/Cargo.toml | 1 + runtime/hydradx/src/evm/erc20_currency.rs | 13 +- runtime/hydradx/src/evm/executor.rs | 9 +- traits/src/evm.rs | 8 + 11 files changed, 590 insertions(+), 29 deletions(-) create mode 100644 integration-tests/src/erc20.rs create mode 100644 integration-tests/src/utils/contracts.rs diff --git a/Cargo.lock b/Cargo.lock index cd8e6c9ec..e7911071b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4883,6 +4883,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", + "hex", "hex-literal 0.4.1", "hydra-dx-math", "hydradx-adapters", @@ -11864,6 +11865,7 @@ dependencies = [ "cumulus-primitives-timestamp", "cumulus-primitives-utility", "cumulus-test-relay-sproof-builder", + "ethabi", "fp-evm", "fp-rpc", "frame-benchmarking", @@ -11873,6 +11875,7 @@ dependencies = [ "frame-system", "frame-system-benchmarking", "frame-system-rpc-runtime-api", + "hex", "hex-literal 0.4.1", "hydradx-adapters", "hydradx-runtime", @@ -11940,6 +11943,7 @@ dependencies = [ "rococo-runtime", "sc-consensus-grandpa", "scraper", + "serde_json", "sp-api", "sp-authority-discovery", "sp-block-builder", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 15b8ee223..0fedb0635 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -132,6 +132,10 @@ polkadot-service = { workspace = true, features = ["full-node"] } polkadot-runtime-parachains = { workspace = true } rococo-runtime = { workspace = true } +ethabi = { version = "18.0.0", default-features = false } +serde_json = "1.0.117" +hex = "0.4.3" + [dev-dependencies] pretty_assertions = "1.2.1" pallet-relaychain-info = { workspace = true } diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs new file mode 100644 index 000000000..3d4c00917 --- /dev/null +++ b/integration-tests/src/erc20.rs @@ -0,0 +1,404 @@ +use crate::polkadot_test_net::*; +use crate::utils::contracts::*; +use core::panic; +use ethabi::ethereum_types::BigEndianHash; +use fp_evm::ExitReason::Succeed; +use frame_support::pallet_prelude::DispatchError::Other; +use frame_support::storage::with_transaction; +use frame_support::{assert_noop, assert_ok}; +use hydradx_runtime::evm::{Erc20Currency, EvmNonceProvider as AccountNonce, Executor, Function}; +use hydradx_runtime::AssetRegistry; +use hydradx_runtime::RuntimeOrigin; +use hydradx_runtime::{AssetLocation, Currencies}; +use hydradx_runtime::{EVMAccounts, Runtime}; +use hydradx_traits::evm::ERC20; +use hydradx_traits::evm::EVM; +use hydradx_traits::evm::{CallContext, EvmAddress}; +use hydradx_traits::AssetKind; +use hydradx_traits::Create; +use orml_traits::MultiCurrency; +use pallet_evm::ExitSucceed::Returned; +use pallet_evm_accounts::EvmNonceProvider; +use polkadot_xcm::v3::Junction::AccountKey20; +use polkadot_xcm::v3::Junctions::X1; +use polkadot_xcm::v3::MultiLocation; +use primitives::AccountId; +use scraper::{ALICE, BOB}; +use sp_core::keccak_256; +use sp_core::{H256, U256}; +use sp_runtime::{Permill, TransactionOutcome}; +use xcm_emulator::TestExt; + +pub fn deployer() -> EvmAddress { + EVMAccounts::evm_address(&Into::::into(ALICE)) +} + +pub fn deploy_token_contract() -> EvmAddress { + deploy_contract("HydraToken", deployer()) +} + +#[test] +fn executor_view_should_return_something() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + let data = Into::::into(Function::TotalSupply).to_be_bytes().to_vec(); + let context = CallContext { + contract: token, + sender: Default::default(), + origin: Default::default(), + }; + let (res, value) = Executor::::view(context, data, 100_000); + + assert_eq!(res, Succeed(Returned)); + assert_ne!(value, vec![0; value.len()]); + }); +} + +#[test] +fn executor_call_wont_bump_nonce() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + // load nonce of deployer + let nonce = AccountNonce::get_nonce(deployer()); + + let mut data = Into::::into(Function::Transfer).to_be_bytes().to_vec(); + data.extend_from_slice(H256::from(evm_address()).as_bytes()); + data.extend_from_slice(H256::from_uint(&U256::from(100)).as_bytes()); + let context = CallContext { + contract: token, + sender: deployer(), + origin: deployer(), + }; + let (res, value) = Executor::::call(context, data, U256::zero(), 100_000); + + assert_eq!(res, Succeed(Returned)); + assert_ne!(value, vec![0; value.len()]); + + assert_eq!(AccountNonce::get_nonce(deployer()), nonce); + }); +} + +#[test] +fn name_should_decode_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::name(CallContext::new_view(token)), + Some("Hydra".as_bytes().to_vec()) + ); + }); +} + +#[test] +fn total_issuance_should_decode_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::total_issuance(token), + 1_000_000_000 * 10u128.pow(18) + ); + }); +} + +#[test] +fn total_supply_should_decode_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::total_supply(CallContext::new_view(token)), + 1_000_000_000 * 10u128.pow(18) + ); + }); +} + +#[test] +fn symbol_should_decode_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::symbol(CallContext::new_view(token)), + Some("HYDRA".as_bytes().to_vec()) + ); + }); +} + +#[test] +fn decimals_should_decode_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::decimals(CallContext::new_view(token)), + Some(18) + ); + }); +} + +#[test] +fn deployer_should_have_balance() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::balance_of(CallContext::new_view(token), deployer()), + 1_000_000_000 * 10u128.pow(18) + ); + }); +} + +#[test] +fn address_should_receive_tokens() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_ok!( as ERC20>::transfer( + CallContext { + contract: token, + sender: deployer(), + origin: deployer() + }, + evm_address(), + 100 + )); + + assert_eq!( + Erc20Currency::::balance_of(CallContext::new_view(token), evm_address()), + 100 + ); + }); +} + +#[test] +fn approve_should_increase_allowance() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_ok!( as ERC20>::approve( + CallContext { + contract: token, + sender: deployer(), + origin: deployer() + }, + evm_address(), + 100 + )); + + assert_eq!( + Erc20Currency::::allowance(CallContext::new_view(token), deployer(), evm_address()), + 100 + ); + }); +} + +#[test] +fn transfer_from_can_spend_allowance() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_ok!( as ERC20>::approve( + CallContext::new_call(token, deployer()), + evm_address(), + 100 + )); + assert_ok!( as ERC20>::transfer_from( + CallContext::new_call(token, evm_address()), + deployer(), + evm_address(), + 100 + )); + + assert_eq!( + Erc20Currency::::balance_of(CallContext::new_view(token), evm_address()), + 100 + ); + assert_eq!( + Erc20Currency::::allowance(CallContext::new_view(token), deployer(), evm_address()), + 0 + ); + }); +} + +#[test] +fn alice_should_have_free_balance() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_eq!( + Erc20Currency::::free_balance(token, &AccountId::from(ALICE)), + 1_000_000_000 * 10u128.pow(18) + ); + }); +} + +#[test] +fn account_should_receive_tokens() { + TestNet::reset(); + Hydra::execute_with(|| { + let token = deploy_token_contract(); + + assert_ok!( as MultiCurrency>::transfer( + token, + &AccountId::from(ALICE), + &AccountId::from(BOB), + 100 + )); + + assert_eq!( + Erc20Currency::::free_balance(token, &AccountId::from(BOB)), + 100 + ); + }); +} + +fn bind_erc20(contract: EvmAddress) -> AssetId { + let token = CallContext::new_view(contract); + let asset = with_transaction(|| { + TransactionOutcome::Commit(AssetRegistry::register_sufficient_asset( + None, + Some(Erc20Currency::::name(token).unwrap().try_into().unwrap()), + AssetKind::Erc20, + 1, + Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), + Some(Erc20Currency::::decimals(token).unwrap().try_into().unwrap()), + Some(AssetLocation(MultiLocation::new( + 0, + X1(AccountKey20 { + key: contract.into(), + network: None, + }), + ))), + None, + )) + }); + asset.unwrap() +} + +#[test] +fn bound_erc20_should_have_issuance() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + + assert_eq!(Currencies::total_issuance(asset), 1_000_000_000 * 10u128.pow(18)); + }); +} + +#[test] +fn currencies_should_transfer_bound_erc20() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + + assert_ok!(Currencies::transfer( + RuntimeOrigin::signed(ALICE.into()), + BOB.into(), + asset, + 100 + )); + + assert_eq!(Currencies::free_balance(asset, &BOB.into()), 100); + assert_eq!(Erc20Currency::::free_balance(contract, &BOB.into()), 100); + }); +} + +fn error_signature(definition: &str) -> String { + let hash = keccak_256(definition.as_bytes()); + hash[..4].iter().map(|b| format!("{:02x}", b)).collect() +} + +#[test] +fn insufficient_balance_should_fail_transfer() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + + match Currencies::transfer(RuntimeOrigin::signed(BOB.into()), ALICE.into(), asset, 100) { + Err(Other(e)) => { + assert!(e.contains(&error_signature("ERC20InsufficientBalance(address,uint256,uint256)"))); + } + _ => panic!("transfer should fail"), + } + }); +} + +#[test] +fn deposit_is_not_supported() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + + assert_noop!( + Currencies::deposit(asset, &ALICE.into(), 100), + pallet_currencies::Error::::NotSupported + ); + }); +} + +#[test] +fn withdraw_is_not_supported() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + + assert_noop!( + Currencies::withdraw(asset, &ALICE.into(), 100), + pallet_currencies::Error::::NotSupported + ); + }); +} + +#[test] +fn erc20_currency_is_tradeable_in_omnipool() { + TestNet::reset(); + Hydra::execute_with(|| { + init_omnipool(); + let contract = deploy_token_contract(); + let erc20 = bind_erc20(contract); + let amount = 1_000_000_000_000_000; + assert_ok!(Currencies::transfer( + RuntimeOrigin::signed(ALICE.into()), + pallet_omnipool::Pallet::::protocol_account(), + erc20, + amount, + )); + assert_ok!(pallet_omnipool::Pallet::::add_token( + RuntimeOrigin::root(), + erc20, + 45_000_000_000.into(), + Permill::from_percent(30), + ALICE.into(), + )); + + assert_ok!(pallet_route_executor::Pallet::::sell( + RuntimeOrigin::signed(ALICE.into()), + erc20, + DAI, + 1_000, + 1, + vec![], + )); + }); +} diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index d514e947d..f0ea63707 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -11,12 +11,12 @@ use hex_literal::hex; use hydradx_runtime::evm::precompiles::DISPATCH_ADDR; use hydradx_runtime::evm::EvmAddress; use hydradx_runtime::evm::ExtendedAddressMapping; +use hydradx_runtime::evm::Function; use hydradx_runtime::XYK; use hydradx_runtime::{ evm::precompiles::{ handle::EvmDataWriter, multicurrency::MultiCurrencyPrecompile, Address, Bytes, HydraDXPrecompiles, }, - evm::Function, AssetRegistry, Balances, CallFilter, Currencies, EVMAccounts, Omnipool, RuntimeCall, RuntimeOrigin, Tokens, TransactionPause, EVM, }; @@ -536,6 +536,9 @@ mod standard_precompiles { mod currency_precompile { use super::*; + use fp_evm::ExitRevert::Reverted; + use fp_evm::PrecompileFailure; + use frame_support::assert_noop; use pretty_assertions::assert_eq; type AllHydraDXPrecompile = HydraDXPrecompiles; @@ -913,21 +916,62 @@ mod currency_precompile { } #[test] - fn precompile_for_currency_allowance_should_fail_as_not_supported() { + fn precompile_for_currency_allowance_should_return_zero_for_not_approved_contract() { TestNet::reset(); Hydra::execute_with(|| { //Arrange let data = EvmDataWriter::new_with_selector(Function::Allowance) + .write(Address::from(evm_address2())) .write(Address::from(evm_address())) + .build(); + + let mut handle = MockHandle { + input: data, + context: Context { + address: native_asset_ethereum_address(), + caller: evm_address(), + apparent_value: U256::from(0), + }, + core_address: native_asset_ethereum_address(), + is_static: true, + }; + + //Act + let result = CurrencyPrecompile::execute(&mut handle); + + //Assert + assert_eq!( + result, + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output: hex!["0000000000000000000000000000000000000000000000000000000000000000"].to_vec() + }) + ); + }); + } + + #[test] + fn precompile_for_currency_allowance_should_return_max_for_approved_contract() { + TestNet::reset(); + + Hydra::execute_with(|| { + //Arrange + assert_ok!(EVMAccounts::approve_contract( + hydradx_runtime::RuntimeOrigin::root(), + evm_address(), + )); + + let data = EvmDataWriter::new_with_selector(Function::Allowance) .write(Address::from(evm_address2())) + .write(Address::from(evm_address())) .build(); let mut handle = MockHandle { input: data, context: Context { - address: evm_address(), - caller: native_asset_ethereum_address(), + address: native_asset_ethereum_address(), + caller: evm_address(), apparent_value: U256::from(0), }, core_address: native_asset_ethereum_address(), @@ -940,15 +984,16 @@ mod currency_precompile { //Assert assert_eq!( result, - Err(PrecompileFailure::Error { - exit_status: pallet_evm::ExitError::Other("not supported".into()) + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output: hex!["00000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"].to_vec() }) ); }); } #[test] - fn precompile_for_transfer_from_should_fail_as_not_supported() { + fn precompile_for_transfer_from_should_fail_for_not_approved_contract() { TestNet::reset(); Hydra::execute_with(|| { @@ -969,8 +1014,55 @@ mod currency_precompile { let mut handle = MockHandle { input: data, context: Context { - address: evm_address(), - caller: evm_address(), + address: native_asset_ethereum_address(), + caller: native_asset_ethereum_address(), + apparent_value: U256::from(0), + }, + core_address: native_asset_ethereum_address(), + is_static: false, + }; + + //Act & Assert + assert_noop!( + CurrencyPrecompile::execute(&mut handle), + PrecompileFailure::Revert { + exit_status: Reverted, + output: "Not approved contract".as_bytes().to_vec() + } + ); + assert_balance!(evm_account2(), HDX, 0); + }); + } + + #[test] + fn precompile_for_transfer_from_is_allowed_for_approved_contract() { + TestNet::reset(); + + Hydra::execute_with(|| { + //Arrange + assert_ok!(EVMAccounts::approve_contract( + hydradx_runtime::RuntimeOrigin::root(), + native_asset_ethereum_address(), + )); + + assert_ok!(hydradx_runtime::Currencies::update_balance( + hydradx_runtime::RuntimeOrigin::root(), + evm_account(), + HDX, + 100 * UNITS as i128, + )); + + let data = EvmDataWriter::new_with_selector(Function::TransferFrom) + .write(Address::from(evm_address())) + .write(Address::from(evm_address2())) + .write(U256::from(50u128 * UNITS)) + .build(); + + let mut handle = MockHandle { + input: data, + context: Context { + address: native_asset_ethereum_address(), + caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, core_address: native_asset_ethereum_address(), @@ -979,15 +1071,16 @@ mod currency_precompile { //Act let result = CurrencyPrecompile::execute(&mut handle); - - //Assert + // Assert + assert_ok!(result.clone()); assert_eq!( result, - Err(PrecompileFailure::Error { - exit_status: pallet_evm::ExitError::Other("not supported".into()) + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output: hex!["0000000000000000000000000000000000000000000000000000000000000001"].to_vec(), }) ); - assert_balance!(evm_account2(), HDX, 0); + assert_balance!(evm_account2(), HDX, 50u128 * UNITS); }); } @@ -997,7 +1090,6 @@ mod currency_precompile { } pub fn alice_evm_addr() -> H160 { - //H160::from(hex_literal::hex!("1000000000000000000000000000000000000001")) account_to_default_evm_address(&ALICE) } diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index 3f51f63ed..ace79c584 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -10,6 +10,7 @@ mod dca; mod dust; mod dust_removal_whitelist; mod dynamic_fees; +mod erc20; mod evm; mod evm_permit; mod exchange_asset; @@ -26,7 +27,7 @@ mod referrals; mod router; mod staking; mod transact_call_filter; -mod utils; +pub mod utils; mod vesting; mod xyk; mod xyk_liquidity_mining; diff --git a/integration-tests/src/utils/contracts.rs b/integration-tests/src/utils/contracts.rs new file mode 100644 index 000000000..c16337c74 --- /dev/null +++ b/integration-tests/src/utils/contracts.rs @@ -0,0 +1,50 @@ +use fp_rpc::runtime_decl_for_ethereum_runtime_rpc_api::EthereumRuntimeRPCApiV5; +use frame_support::assert_ok; +use hydradx_runtime::EVMAccounts; +use hydradx_traits::evm::EvmAddress; +use pallet_evm::ExitReason; +use sp_core::U256; +use std::fs; + +pub fn get_contract_bytecode(name: &str) -> Vec { + let path = format!( + "../scripts/test-contracts/artifacts/contracts/{}.sol/{}.json", + name, name + ); + let str = fs::read_to_string(path).unwrap(); + let json: serde_json::Value = serde_json::from_str(&str).unwrap(); + let code = json.get("bytecode").unwrap().as_str().unwrap(); + hex::decode(&code[2..]).unwrap() +} + +pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { + assert_ok!(EVMAccounts::add_contract_deployer( + hydradx_runtime::RuntimeOrigin::root(), + deployer, + )); + + let info = hydradx_runtime::Runtime::create( + deployer, + code.clone(), + U256::zero(), + U256::from(2000000u64), + None, + None, + None, + false, + None, + ); + + let address = match info.clone().unwrap().exit_reason { + ExitReason::Succeed(_) => info.unwrap().value, + reason => panic!("{:?}", reason), + }; + + let deployed = hydradx_runtime::Runtime::account_code_at(address.clone()); + assert_ne!(deployed, vec![0; deployed.len()]); + address +} + +pub fn deploy_contract(name: &str, deployer: EvmAddress) -> EvmAddress { + deploy_contract_code(get_contract_bytecode(name), deployer) +} diff --git a/integration-tests/src/utils/mod.rs b/integration-tests/src/utils/mod.rs index 9072718d2..5e424b784 100644 --- a/integration-tests/src/utils/mod.rs +++ b/integration-tests/src/utils/mod.rs @@ -1 +1,2 @@ pub(crate) mod accounts; +pub(crate) mod contracts; diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 285bfed06..751d3d8bc 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -161,6 +161,7 @@ pallet-evm-precompile-call-permit = { workspace = true } precompile-utils = { workspace = true } module-evm-utility-macro = { workspace = true } ethabi = { version = "18.0.0", default-features = false } +hex = "0.4.3" [features] default = ["std"] diff --git a/runtime/hydradx/src/evm/erc20_currency.rs b/runtime/hydradx/src/evm/erc20_currency.rs index 03fe8e245..3943b02b2 100644 --- a/runtime/hydradx/src/evm/erc20_currency.rs +++ b/runtime/hydradx/src/evm/erc20_currency.rs @@ -172,21 +172,14 @@ fn decode_integer(value: Vec) -> Option { U256::checked_from(value.as_slice()) } -fn decode_bool(value: Vec) -> bool { - let mut bytes = [0u8; 32]; - U256::from(1).to_big_endian(&mut bytes); - value == bytes -} - fn handle_result(result: CallResult) -> DispatchResult { let (exit_reason, value) = result; - if decode_bool(value) != true { - return Err(DispatchError::Other("erc20 invalid return value")); - } match exit_reason { ExitReason::Succeed(ExitSucceed::Returned) => Ok(()), ExitReason::Succeed(ExitSucceed::Stopped) => Ok(()), - _ => Err(DispatchError::Other("erc20 call failed")), + _ => Err(DispatchError::Other(&*Box::leak( + format!("evm:0x{}", hex::encode(value)).into_boxed_str(), + ))), } } diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 37a978c9e..95fad9adf 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -6,7 +6,7 @@ use frame_support::storage::with_transaction; use frame_support::traits::Get; use hydradx_traits::evm::{CallContext, EVM}; use pallet_evm::runner::stack::SubstrateStackState; -use pallet_evm::Config; +use pallet_evm::{AddressMapping, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; @@ -40,9 +40,12 @@ where let precompiles = T::PrecompilesValue::get(); let metadata = StackSubstateMetadata::new(gas, config); let state = SubstrateStackState::new(&vicinity, metadata, None, None); + let account = T::AddressMapping::into_account_id(origin); + let nonce = frame_system::Account::::get(account.clone()).nonce; let mut executor = StackExecutor::new_with_precompiles(state, config, &precompiles); - - f(&mut executor) + let result = f(&mut executor); + frame_system::Account::::mutate(account, |a| a.nonce = nonce); + result } } diff --git a/traits/src/evm.rs b/traits/src/evm.rs index 9c087628c..18cf51209 100644 --- a/traits/src/evm.rs +++ b/traits/src/evm.rs @@ -46,6 +46,14 @@ impl CallContext { } } + pub fn new_call(contract: EvmAddress, sender: EvmAddress) -> Self { + Self { + contract, + sender, + origin: sender, + } + } + pub fn new_view(contract: EvmAddress) -> Self { Self { contract, From 4e7f73d6e706630a1b690a5572ddc2dfeb494eb6 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 6 Sep 2024 04:31:39 +0200 Subject: [PATCH 05/57] versions bump --- Cargo.lock | 32 ++++++------ integration-tests/Cargo.toml | 2 +- pallets/asset-registry/Cargo.toml | 2 +- pallets/currencies/Cargo.toml | 2 +- pallets/dca/Cargo.toml | 2 +- pallets/duster/Cargo.toml | 2 +- pallets/dynamic-evm-fee/Cargo.toml | 8 +-- pallets/evm-accounts/Cargo.toml | 26 +++++----- pallets/otc-settlements/Cargo.toml | 52 +++++++++---------- pallets/otc/Cargo.toml | 34 ++++++------ pallets/route-executor/Cargo.toml | 24 ++++----- pallets/transaction-multi-payment/Cargo.toml | 6 +-- primitives/Cargo.toml | 4 +- runtime/adapters/Cargo.toml | 2 +- runtime/hydradx/Cargo.toml | 2 +- .../hydradx/src/evm/evm-utility/Cargo.toml | 2 +- runtime/hydradx/src/lib.rs | 2 +- traits/Cargo.toml | 2 +- 18 files changed, 103 insertions(+), 103 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7911071b..4ce669110 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4810,7 +4810,7 @@ dependencies = [ [[package]] name = "hydradx-adapters" -version = "1.3.5" +version = "1.3.6" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -4860,7 +4860,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "256.0.0" +version = "257.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -4996,7 +4996,7 @@ dependencies = [ [[package]] name = "hydradx-traits" -version = "3.4.0" +version = "3.5.0" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -6647,7 +6647,7 @@ dependencies = [ [[package]] name = "module-evm-utility" -version = "2.21.0" +version = "2.21.1" dependencies = [ "ethereum", "evm", @@ -7424,7 +7424,7 @@ dependencies = [ [[package]] name = "pallet-asset-registry" -version = "3.2.4" +version = "3.3.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -7843,7 +7843,7 @@ dependencies = [ [[package]] name = "pallet-currencies" -version = "2.1.1" +version = "3.0.0" dependencies = [ "frame-support", "frame-system", @@ -7863,7 +7863,7 @@ dependencies = [ [[package]] name = "pallet-dca" -version = "1.5.1" +version = "1.5.2" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -7939,7 +7939,7 @@ dependencies = [ [[package]] name = "pallet-duster" -version = "3.2.5" +version = "3.2.6" dependencies = [ "frame-benchmarking", "frame-support", @@ -7963,7 +7963,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-evm-fee" -version = "1.0.2" +version = "1.0.3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8139,7 +8139,7 @@ dependencies = [ [[package]] name = "pallet-evm-accounts" -version = "1.1.2" +version = "1.2.0" dependencies = [ "frame-benchmarking", "frame-support", @@ -8671,7 +8671,7 @@ dependencies = [ [[package]] name = "pallet-otc" -version = "2.0.1" +version = "2.0.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -8693,7 +8693,7 @@ dependencies = [ [[package]] name = "pallet-otc-settlements" -version = "1.0.3" +version = "1.0.4" dependencies = [ "frame-benchmarking", "frame-support", @@ -8861,7 +8861,7 @@ dependencies = [ [[package]] name = "pallet-route-executor" -version = "2.5.1" +version = "2.5.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -9135,7 +9135,7 @@ dependencies = [ [[package]] name = "pallet-transaction-multi-payment" -version = "10.0.4" +version = "10.0.5" dependencies = [ "frame-support", "frame-system", @@ -11021,7 +11021,7 @@ dependencies = [ [[package]] name = "primitives" -version = "6.0.3" +version = "6.1.0" dependencies = [ "frame-support", "hex-literal 0.3.4", @@ -11854,7 +11854,7 @@ dependencies = [ [[package]] name = "runtime-integration-tests" -version = "1.23.2" +version = "1.24.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 0fedb0635..edd38ce42 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "runtime-integration-tests" -version = "1.23.2" +version = "1.24.0" description = "Integration tests" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/asset-registry/Cargo.toml b/pallets/asset-registry/Cargo.toml index cb06498d0..c13312724 100644 --- a/pallets/asset-registry/Cargo.toml +++ b/pallets/asset-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-asset-registry" -version = "3.2.4" +version = "3.3.0" description = "Pallet for asset registry management" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/currencies/Cargo.toml b/pallets/currencies/Cargo.toml index 8085a04bc..b69e23ace 100644 --- a/pallets/currencies/Cargo.toml +++ b/pallets/currencies/Cargo.toml @@ -3,7 +3,7 @@ name = "pallet-currencies" description = "Provide `MultiCurrency` implementation using `pallet-balances` and `orml-tokens` module." repository = "https://github.com/open-web3-stack/open-runtime-module-library/tree/master/currencies" license = "Apache-2.0" -version = "2.1.1" +version = "3.0.0" authors = ["Laminar Developers "] edition = "2021" diff --git a/pallets/dca/Cargo.toml b/pallets/dca/Cargo.toml index 89d83ea1a..6b769df9e 100644 --- a/pallets/dca/Cargo.toml +++ b/pallets/dca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-dca' -version = "1.5.1" +version = "1.5.2" description = 'A pallet to manage DCA scheduling' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/duster/Cargo.toml b/pallets/duster/Cargo.toml index 073910cd1..1872dcfee 100644 --- a/pallets/duster/Cargo.toml +++ b/pallets/duster/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-duster" -version = "3.2.5" +version = "3.2.6" description = "Account duster" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/dynamic-evm-fee/Cargo.toml b/pallets/dynamic-evm-fee/Cargo.toml index 7ee724aa4..acfdfd28b 100644 --- a/pallets/dynamic-evm-fee/Cargo.toml +++ b/pallets/dynamic-evm-fee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-dynamic-evm-fee" -version = "1.0.2" +version = "1.0.3" description = "Storing and mutating the dynamic fee for EVM transactions." authors = ["GalacticCoucil"] edition = "2021" @@ -29,7 +29,7 @@ frame-system = { workspace = true } sp-api = { workspace = true } sp-std = { workspace = true } sp-runtime = { workspace = true } -sp-core = { workspace = true} +sp-core = { workspace = true } # Evm dependencies pallet-evm = { workspace = true } @@ -40,8 +40,8 @@ sp-io = { workspace = true, optional = true } [dev-dependencies] pallet-currencies = { workspace = true } -orml-tokens = { workspace = true, features=["std"] } -pallet-balances = { workspace = true, features=["std"] } +orml-tokens = { workspace = true, features = ["std"] } +pallet-balances = { workspace = true, features = ["std"] } test-utils = { workspace = true } pallet-transaction-payment = { workspace = true } frame-benchmarking = { workspace = true } diff --git a/pallets/evm-accounts/Cargo.toml b/pallets/evm-accounts/Cargo.toml index 5fc8abfbe..c5ba97990 100644 --- a/pallets/evm-accounts/Cargo.toml +++ b/pallets/evm-accounts/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-evm-accounts" -version = "1.1.2" +version = "1.2.0" authors = ['GalacticCouncil'] edition = "2021" license = "Apache-2.0" @@ -39,18 +39,18 @@ hex-literal = "0.4.1" [features] default = ["std"] std = [ - "codec/std", - "scale-info/std", - "sp-std/std", - "sp-core/std", - "sp-io/std", - "frame-support/std", - "frame-system/std", - "orml-tokens/std", - "frame-benchmarking/std", + "codec/std", + "scale-info/std", + "sp-std/std", + "sp-core/std", + "sp-io/std", + "frame-support/std", + "frame-system/std", + "orml-tokens/std", + "frame-benchmarking/std", ] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "sp-io", + "frame-benchmarking/runtime-benchmarks", + "sp-io", ] -try-runtime = [ "frame-support/try-runtime" ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/otc-settlements/Cargo.toml b/pallets/otc-settlements/Cargo.toml index 24e23f5d2..7a627f3e4 100644 --- a/pallets/otc-settlements/Cargo.toml +++ b/pallets/otc-settlements/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-otc-settlements' -version = '1.0.3' +version = '1.0.4' description = 'A pallet with offchain worker closing OTC arbs' authors = ['GalacticCouncil'] edition = '2021' @@ -41,7 +41,7 @@ pallet-balances = { workspace = true } pallet-currencies = { workspace = true } sp-api = { workspace = true } orml-traits = { workspace = true } -orml-tokens = { workspace = true, features=["std"] } +orml-tokens = { workspace = true, features = ["std"] } proptest = "1.0.0" pretty_assertions = "1.2.1" test-utils = { workspace = true } @@ -50,32 +50,32 @@ parking_lot = "0.12.1" [features] default = ['std'] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'sp-runtime/std', - 'sp-core/std', - 'sp-io/std', - 'sp-std/std', - 'sp-arithmetic/std', - 'sp-api/std', - 'scale-info/std', - 'orml-tokens/std', - 'orml-traits/std', - 'hydradx-traits/std', - 'hydra-dx-math/std', - 'frame-benchmarking/std', - 'pallet-otc/std', - 'pallet-balances/std', - 'pallet-currencies/std', - 'pallet-route-executor/std', - 'pallet-omnipool/std', - 'pallet-asset-registry/std', + 'codec/std', + 'frame-support/std', + 'frame-system/std', + 'sp-runtime/std', + 'sp-core/std', + 'sp-io/std', + 'sp-std/std', + 'sp-arithmetic/std', + 'sp-api/std', + 'scale-info/std', + 'orml-tokens/std', + 'orml-traits/std', + 'hydradx-traits/std', + 'hydra-dx-math/std', + 'frame-benchmarking/std', + 'pallet-otc/std', + 'pallet-balances/std', + 'pallet-currencies/std', + 'pallet-route-executor/std', + 'pallet-omnipool/std', + 'pallet-asset-registry/std', ] runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/otc/Cargo.toml b/pallets/otc/Cargo.toml index 97633fbdf..94dbaf77a 100644 --- a/pallets/otc/Cargo.toml +++ b/pallets/otc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-otc' -version = '2.0.1' +version = '2.0.2' description = 'A pallet for trustless over-the-counter trading' authors = ['GalacticCouncil'] edition = '2021' @@ -33,7 +33,7 @@ frame-benchmarking = { workspace = true, optional = true } [dev-dependencies] sp-api = { workspace = true } sp-io = { workspace = true } -orml-tokens = { workspace = true, features=["std"] } +orml-tokens = { workspace = true, features = ["std"] } proptest = "1.0.0" pretty_assertions = "1.2.1" test-utils = { workspace = true } @@ -41,23 +41,23 @@ test-utils = { workspace = true } [features] default = ['std'] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'sp-runtime/std', - 'sp-core/std', - 'sp-io/std', - 'sp-std/std', - 'scale-info/std', - 'orml-tokens/std', - 'orml-traits/std', - 'hydradx-traits/std', - 'frame-benchmarking/std' + 'codec/std', + 'frame-support/std', + 'frame-system/std', + 'sp-runtime/std', + 'sp-core/std', + 'sp-io/std', + 'sp-std/std', + 'scale-info/std', + 'orml-tokens/std', + 'orml-traits/std', + 'hydradx-traits/std', + 'frame-benchmarking/std' ] runtime-benchmarks = [ - "frame-benchmarking", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/route-executor/Cargo.toml b/pallets/route-executor/Cargo.toml index 839ef0e51..6c45f1de6 100644 --- a/pallets/route-executor/Cargo.toml +++ b/pallets/route-executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-route-executor' -version = '2.5.1' +version = '2.5.2' description = 'A pallet to execute a route containing a sequence of trades' authors = ['GalacticCouncil'] edition = '2021' @@ -39,18 +39,18 @@ test-utils = { workspace = true } [features] default = ['std'] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "frame-system/runtime-benchmarks", - "frame-support/runtime-benchmarks", + "frame-benchmarking/runtime-benchmarks", + "frame-system/runtime-benchmarks", + "frame-support/runtime-benchmarks", ] std = [ - 'serde/std', - 'codec/std', - 'sp-std/std', - 'frame-support/std', - 'frame-system/std', - 'orml-tokens/std', - "hydradx-adapters/std", - "pallet-balances/std", + 'serde/std', + 'codec/std', + 'sp-std/std', + 'frame-support/std', + 'frame-system/std', + 'orml-tokens/std', + "hydradx-adapters/std", + "pallet-balances/std", ] try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/transaction-multi-payment/Cargo.toml b/pallets/transaction-multi-payment/Cargo.toml index 6091feb80..2eca40279 100644 --- a/pallets/transaction-multi-payment/Cargo.toml +++ b/pallets/transaction-multi-payment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-transaction-multi-payment" -version = "10.0.4" +version = "10.0.5" description = "Transaction multi currency payment support module" authors = ["GalacticCoucil"] edition = "2021" @@ -36,8 +36,8 @@ pallet-evm = { workspace = true, optional = true } [dev-dependencies] pallet-currencies = { workspace = true } -orml-tokens = { workspace = true, features=["std"] } -pallet-balances = { workspace = true, features=["std"] } +orml-tokens = { workspace = true, features = ["std"] } +pallet-balances = { workspace = true, features = ["std"] } pallet-evm-accounts = { workspace = true, features = ["std"] } sp-io = { workspace = true } test-utils = { workspace = true } diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index b62a44c7e..d703abc71 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "primitives" -version = "6.0.3" +version = "6.1.0" authors = ["GalacticCouncil"] edition = "2021" repository = "https://github.com/galacticcouncil/HydraDX-node" @@ -9,7 +9,7 @@ repository = "https://github.com/galacticcouncil/HydraDX-node" codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { features = ["derive"], optional = true, version = "1.0.136" } -hex-literal = {version = '0.3.4'} +hex-literal = { version = '0.3.4' } static_assertions = "1.1.0" # Substrate dependencies diff --git a/runtime/adapters/Cargo.toml b/runtime/adapters/Cargo.toml index d6ca4836a..8ad16d7de 100644 --- a/runtime/adapters/Cargo.toml +++ b/runtime/adapters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-adapters" -version = "1.3.5" +version = "1.3.6" description = "Structs and other generic types for building runtimes." authors = ["GalacticCouncil"] edition = "2021" diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 751d3d8bc..e5428e45c 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "256.0.0" +version = "257.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/evm/evm-utility/Cargo.toml b/runtime/hydradx/src/evm/evm-utility/Cargo.toml index b897dc7a5..5138375da 100644 --- a/runtime/hydradx/src/evm/evm-utility/Cargo.toml +++ b/runtime/hydradx/src/evm/evm-utility/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "module-evm-utility" -version = "2.21.0" +version = "2.21.1" authors = ["Acala Developers"] edition = "2021" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 8e5c13482..601894f5f 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -113,7 +113,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 256, + spec_version: 257, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/traits/Cargo.toml b/traits/Cargo.toml index d162a8230..2a08d0e31 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-traits" -version = "3.4.0" +version = "3.5.0" description = "Shared traits" authors = ["GalacticCouncil"] edition = "2021" From 7b5ad85e80a8bcb7c3f1204c5b2ebe4de6f66295 Mon Sep 17 00:00:00 2001 From: dmoka Date: Mon, 9 Sep 2024 17:51:57 +0200 Subject: [PATCH 06/57] upgrade imports to make it compile --- integration-tests/Cargo.toml | 2 +- pallets/currencies/src/lib.rs | 1 + runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/evm/erc20_currency.rs | 2 ++ runtime/hydradx/src/evm/executor.rs | 3 +++ traits/src/evm.rs | 2 +- 6 files changed, 9 insertions(+), 3 deletions(-) diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index edd38ce42..06ce92007 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -134,7 +134,7 @@ rococo-runtime = { workspace = true } ethabi = { version = "18.0.0", default-features = false } serde_json = "1.0.117" -hex = "0.4.3" +hex = { version = "0.4.3", default-features = false } [dev-dependencies] pretty_assertions = "1.2.1" diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index e230a9495..b3135ac7c 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -59,6 +59,7 @@ use orml_traits::{ LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, MultiReservableCurrency, NamedBasicReservableCurrency, NamedMultiReservableCurrency, }; +use sp_std::vec::Vec; use orml_utilities::with_transaction_result; use sp_runtime::{ traits::{CheckedSub, MaybeSerializeDeserialize, StaticLookup, Zero}, diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index e5428e45c..e0bda0634 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -161,7 +161,7 @@ pallet-evm-precompile-call-permit = { workspace = true } precompile-utils = { workspace = true } module-evm-utility-macro = { workspace = true } ethabi = { version = "18.0.0", default-features = false } -hex = "0.4.3" +hex = { version = "0.4.3", default-features = false } [features] default = ["std"] diff --git a/runtime/hydradx/src/evm/erc20_currency.rs b/runtime/hydradx/src/evm/erc20_currency.rs index 3943b02b2..c603d4ee9 100644 --- a/runtime/hydradx/src/evm/erc20_currency.rs +++ b/runtime/hydradx/src/evm/erc20_currency.rs @@ -15,6 +15,8 @@ use sp_core::{H160, H256, U256}; use sp_runtime::traits::{CheckedConversion, Zero}; use sp_runtime::{DispatchError, SaturatedConversion}; use sp_std::vec::Vec; +use scale_info::prelude::format; +use sp_std::boxed::Box; #[module_evm_utility_macro::generate_function_selector] #[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 95fad9adf..9844ef4d9 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -9,6 +9,9 @@ use pallet_evm::runner::stack::SubstrateStackState; use pallet_evm::{AddressMapping, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; +use sp_std::vec::Vec; +use sp_std::vec; + pub struct Executor(sp_std::marker::PhantomData); diff --git a/traits/src/evm.rs b/traits/src/evm.rs index 18cf51209..9f68b1bdd 100644 --- a/traits/src/evm.rs +++ b/traits/src/evm.rs @@ -1,7 +1,7 @@ use codec::{Decode, Encode}; use frame_support::sp_runtime::app_crypto::sp_core::{H160, U256}; use frame_support::sp_runtime::{DispatchResult, RuntimeDebug}; - +use sp_std::vec::Vec; pub trait InspectEvmAccounts { /// Returns `True` if the account is EVM truncated account. fn is_evm_account(account_id: AccountId) -> bool; From 9ee1245dd3d57ac73e9d65c5c1ddfc60060a9836 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 9 Sep 2024 23:44:15 +0200 Subject: [PATCH 07/57] dispatch integration test --- integration-tests/src/erc20.rs | 36 +++++++++++++++++++- integration-tests/src/evm.rs | 60 +++++++++++++++++++--------------- 2 files changed, 68 insertions(+), 28 deletions(-) diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs index 3d4c00917..b8b5c19ee 100644 --- a/integration-tests/src/erc20.rs +++ b/integration-tests/src/erc20.rs @@ -1,13 +1,17 @@ +use crate::evm::MockHandle; use crate::polkadot_test_net::*; use crate::utils::contracts::*; use core::panic; use ethabi::ethereum_types::BigEndianHash; use fp_evm::ExitReason::Succeed; +use fp_evm::PrecompileSet; use frame_support::pallet_prelude::DispatchError::Other; use frame_support::storage::with_transaction; use frame_support::{assert_noop, assert_ok}; +use hydradx_runtime::evm::precompiles::HydraDXPrecompiles; use hydradx_runtime::evm::{Erc20Currency, EvmNonceProvider as AccountNonce, Executor, Function}; use hydradx_runtime::AssetRegistry; +use hydradx_runtime::RuntimeCall; use hydradx_runtime::RuntimeOrigin; use hydradx_runtime::{AssetLocation, Currencies}; use hydradx_runtime::{EVMAccounts, Runtime}; @@ -25,6 +29,7 @@ use polkadot_xcm::v3::MultiLocation; use primitives::AccountId; use scraper::{ALICE, BOB}; use sp_core::keccak_256; +use sp_core::Encode; use sp_core::{H256, U256}; use sp_runtime::{Permill, TransactionOutcome}; use xcm_emulator::TestExt; @@ -62,7 +67,6 @@ fn executor_call_wont_bump_nonce() { Hydra::execute_with(|| { let token = deploy_token_contract(); - // load nonce of deployer let nonce = AccountNonce::get_nonce(deployer()); let mut data = Into::::into(Function::Transfer).to_be_bytes().to_vec(); @@ -402,3 +406,33 @@ fn erc20_currency_is_tradeable_in_omnipool() { )); }); } + +#[test] +fn erc20_currency_transfer_should_be_callable_using_dispatch_precompile() { + TestNet::reset(); + Hydra::execute_with(|| { + // Arrange + let contract = deploy_token_contract(); + let erc20 = bind_erc20(contract); + assert_ok!(Currencies::transfer( + RuntimeOrigin::signed(ALICE.into()), + evm_account(), + erc20, + 1000, + )); + + // Act + let call = RuntimeCall::Currencies(pallet_currencies::Call::transfer { + dest: BOB.into(), + currency_id: erc20, + amount: 100, + }); + let prec = HydraDXPrecompiles::::new(); + assert_ok!(prec + .execute(&mut MockHandle::new_dispatch(evm_address(), call.encode())) + .unwrap()); + + //Assert + assert_eq!(Currencies::free_balance(erc20, &BOB.into()), 100); + }); +} diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index f0ea63707..cdeee026c 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -163,7 +163,7 @@ mod account_conversion { caller: evm_address, apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -206,7 +206,7 @@ mod account_conversion { caller: evm_address, apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -559,7 +559,7 @@ mod currency_precompile { caller: evm_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -595,7 +595,7 @@ mod currency_precompile { caller: evm_address(), apparent_value: U256::from(0), }, - core_address: H160::from(hex!("00000000000000000000000000000001ffffffff")), + code_address: H160::from(hex!("00000000000000000000000000000001ffffffff")), is_static: true, }; @@ -628,7 +628,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -676,7 +676,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -724,7 +724,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -763,7 +763,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -811,7 +811,7 @@ mod currency_precompile { caller: alice_evm_addr(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -860,7 +860,7 @@ mod currency_precompile { caller: evm_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: false, }; @@ -898,7 +898,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -933,7 +933,7 @@ mod currency_precompile { caller: evm_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -974,7 +974,7 @@ mod currency_precompile { caller: evm_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: true, }; @@ -1018,7 +1018,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: false, }; @@ -1065,7 +1065,7 @@ mod currency_precompile { caller: native_asset_ethereum_address(), apparent_value: U256::from(0), }, - core_address: native_asset_ethereum_address(), + code_address: native_asset_ethereum_address(), is_static: false, }; @@ -1622,19 +1622,25 @@ pub fn gas_price() -> U256 { U256::from(hydradx_runtime::evm::DEFAULT_BASE_FEE_PER_GAS) } -fn create_dispatch_handle(data: Vec) -> MockHandle { - MockHandle { - input: data, - context: Context { - address: DISPATCH_ADDR, - caller: evm_address(), - apparent_value: U256::zero(), - }, - core_address: DISPATCH_ADDR, - is_static: true, +impl MockHandle { + pub fn new_dispatch(sender: H160, data: Vec) -> Self { + Self { + input: data, + context: Context { + address: DISPATCH_ADDR, + caller: sender, + apparent_value: U256::zero(), + }, + code_address: DISPATCH_ADDR, + is_static: true, + } } } +pub fn create_dispatch_handle(data: Vec) -> MockHandle { + MockHandle::new_dispatch(evm_address(), data) +} + pub fn native_asset_ethereum_address() -> H160 { H160::from(hex!("0000000000000000000000000000000100000000")) } @@ -1642,7 +1648,7 @@ pub fn native_asset_ethereum_address() -> H160 { pub struct MockHandle { pub input: Vec, pub context: Context, - pub core_address: H160, + pub code_address: H160, pub is_static: bool, } @@ -1683,7 +1689,7 @@ impl PrecompileHandle for MockHandle { } fn code_address(&self) -> H160 { - self.core_address + self.code_address } fn input(&self) -> &[u8] { From 0fca67b69a666df195c88df6abd149b3292b165c Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 9 Sep 2024 23:45:25 +0200 Subject: [PATCH 08/57] currencies free balance runtime api --- Cargo.lock | 11 +++++++++ Cargo.toml | 2 ++ pallets/currencies/rpc/runtime-api/Cargo.toml | 23 +++++++++++++++++++ pallets/currencies/rpc/runtime-api/src/lib.rs | 13 +++++++++++ runtime/hydradx/Cargo.toml | 2 ++ runtime/hydradx/src/lib.rs | 11 +++++++++ 6 files changed, 62 insertions(+) create mode 100644 pallets/currencies/rpc/runtime-api/Cargo.toml create mode 100644 pallets/currencies/rpc/runtime-api/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index 8bacf1a17..5a45c26f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4911,6 +4911,7 @@ dependencies = [ "pallet-collator-selection", "pallet-collective", "pallet-currencies", + "pallet-currencies-rpc-runtime-api", "pallet-dca", "pallet-democracy 4.3.0", "pallet-duster", @@ -7861,6 +7862,16 @@ dependencies = [ "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2)", ] +[[package]] +name = "pallet-currencies-rpc-runtime-api" +version = "1.0.0" +dependencies = [ + "sp-api", + "sp-core", + "sp-runtime", + "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2)", +] + [[package]] name = "pallet-dca" version = "1.5.2" diff --git a/Cargo.toml b/Cargo.toml index c170ffbf9..388335da1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ members = [ 'pallets/ema-oracle', 'pallets/liquidity-mining', 'pallets/currencies', + 'pallets/currencies/rpc/runtime-api', 'pallets/stableswap', 'utils/test-utils', 'pallets/dynamic-fees', @@ -77,6 +78,7 @@ pallet-circuit-breaker = { path = "pallets/circuit-breaker", default-features = pallet-claims = { path = "pallets/claims", default-features = false } pallet-collator-rewards = { path = "pallets/collator-rewards", default-features = false } pallet-currencies = { path = "pallets/currencies", default-features = false } +pallet-currencies-rpc-runtime-api = { path = "pallets/currencies/rpc/runtime-api", default-features = false } pallet-dca = { path = "pallets/dca", default-features = false } pallet-duster = { path = "pallets/duster", default-features = false } pallet-dynamic-fees = { path = "pallets/dynamic-fees", default-features = false } diff --git a/pallets/currencies/rpc/runtime-api/Cargo.toml b/pallets/currencies/rpc/runtime-api/Cargo.toml new file mode 100644 index 000000000..ce5384196 --- /dev/null +++ b/pallets/currencies/rpc/runtime-api/Cargo.toml @@ -0,0 +1,23 @@ +[package] +name = "pallet-currencies-rpc-runtime-api" +version = "1.0.0" +description = "Currencies runtime api" +authors = ["GalacticCouncil"] +edition = "2021" +license = "Apache 2.0" +repository = "https://github.com/galacticcouncil/hydration-node" + +[dependencies] +sp-runtime = { workspace = true } +sp-api = { workspace = true } +sp-std = { workspace = true } +sp-core = { workspace = true } + +[features] +default = ["std"] +std = [ + "sp-runtime/std", + "sp-api/std", + "sp-std/std", + "sp-core/std", +] diff --git a/pallets/currencies/rpc/runtime-api/src/lib.rs b/pallets/currencies/rpc/runtime-api/src/lib.rs new file mode 100644 index 000000000..a02c055db --- /dev/null +++ b/pallets/currencies/rpc/runtime-api/src/lib.rs @@ -0,0 +1,13 @@ +#![cfg_attr(not(feature = "std"), no_std)] + +use sp_runtime::codec::Codec; + +sp_api::decl_runtime_apis! { + pub trait CurrenciesApi where + AssetId: Codec, + AccountId: Codec, + Balance: Codec, + { + fn free_balance(asset_id: AssetId, who: AccountId) -> Balance; + } +} diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index e0bda0634..949cbb28d 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -73,6 +73,7 @@ pallet-transaction-multi-payment = { workspace = true, features = ["evm"] } pallet-asset-registry = { workspace = true } pallet-collator-rewards = { workspace = true } pallet-currencies = { workspace = true } +pallet-currencies-rpc-runtime-api = { workspace = true } pallet-ema-oracle = { workspace = true } pallet-transaction-pause = { workspace = true } pallet-duster = { workspace = true } @@ -272,6 +273,7 @@ std = [ "pallet-genesis-history/std", "pallet-asset-registry/std", "pallet-currencies/std", + "pallet-currencies-rpc-runtime-api/std", "pallet-omnipool/std", "pallet-circuit-breaker/std", "pallet-transaction-pause/std", diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 601894f5f..607a3273b 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -70,6 +70,7 @@ use frame_support::{ weights::Weight, }; pub use hex_literal::hex; +use orml_traits::MultiCurrency; /// Import HydraDX pallets pub use pallet_claims; use pallet_ethereum::{Transaction as EthereumTransaction, TransactionStatus}; @@ -405,6 +406,16 @@ impl_runtime_apis! { } } + impl pallet_currencies_rpc_runtime_api::CurrenciesApi< + Block, + AssetId, + AccountId, + Balance, + > for Runtime { + fn free_balance(asset_id: AssetId, who: AccountId) -> Balance { + Currencies::free_balance(asset_id, &who) + } + } impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Index { From 5e492772bde686a50a271f90a20df463bb0ca927 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 01:50:23 +0200 Subject: [PATCH 09/57] clippy appreciation commit --- integration-tests/src/erc20.rs | 8 ++++++-- integration-tests/src/router.rs | 2 -- integration-tests/src/utils/contracts.rs | 2 +- runtime/hydradx/src/evm/executor.rs | 3 +-- runtime/hydradx/src/evm/precompiles/multicurrency.rs | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs index b8b5c19ee..888b4c918 100644 --- a/integration-tests/src/erc20.rs +++ b/integration-tests/src/erc20.rs @@ -2,6 +2,7 @@ use crate::evm::MockHandle; use crate::polkadot_test_net::*; use crate::utils::contracts::*; use core::panic; +use std::fmt::Write; use ethabi::ethereum_types::BigEndianHash; use fp_evm::ExitReason::Succeed; use fp_evm::PrecompileSet; @@ -281,7 +282,7 @@ fn bind_erc20(contract: EvmAddress) -> AssetId { AssetKind::Erc20, 1, Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), - Some(Erc20Currency::::decimals(token).unwrap().try_into().unwrap()), + Some(Erc20Currency::::decimals(token).unwrap()), Some(AssetLocation(MultiLocation::new( 0, X1(AccountKey20 { @@ -327,7 +328,10 @@ fn currencies_should_transfer_bound_erc20() { fn error_signature(definition: &str) -> String { let hash = keccak_256(definition.as_bytes()); - hash[..4].iter().map(|b| format!("{:02x}", b)).collect() + hash[..4].iter().fold(String::new(), |mut acc, b| { + write!(&mut acc, "{:02x}", b).unwrap(); + acc + }) } #[test] diff --git a/integration-tests/src/router.rs b/integration-tests/src/router.rs index b69445dc2..e68797d06 100644 --- a/integration-tests/src/router.rs +++ b/integration-tests/src/router.rs @@ -1352,7 +1352,6 @@ mod omnipool_router_tests { let extra_ed_charge = UNITS / 10; assert_balance!(ALICE.into(), HDX, 1000 * UNITS - ed); - let amount_to_sell = amount_to_sell; assert_ok!(Router::sell( hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), insufficient_asset_1, @@ -5408,7 +5407,6 @@ mod sell_all { assert_balance!(ALICE.into(), pool_id, 0); //Act - let amount_to_sell = 3000 * UNITS; assert_ok!(Router::sell_all( hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), stable_asset_1, diff --git a/integration-tests/src/utils/contracts.rs b/integration-tests/src/utils/contracts.rs index c16337c74..6f645391d 100644 --- a/integration-tests/src/utils/contracts.rs +++ b/integration-tests/src/utils/contracts.rs @@ -40,7 +40,7 @@ pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { reason => panic!("{:?}", reason), }; - let deployed = hydradx_runtime::Runtime::account_code_at(address.clone()); + let deployed = hydradx_runtime::Runtime::account_code_at(address); assert_ne!(deployed, vec![0; deployed.len()]); address } diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 9844ef4d9..d29307535 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -35,8 +35,7 @@ where let gas_price = U256::one(); let vicinity = Vicinity { gas_price, - origin, - ..Default::default() + origin }; let config = ::config(); diff --git a/runtime/hydradx/src/evm/precompiles/multicurrency.rs b/runtime/hydradx/src/evm/precompiles/multicurrency.rs index 0e0916267..8a5e21b9c 100644 --- a/runtime/hydradx/src/evm/precompiles/multicurrency.rs +++ b/runtime/hydradx/src/evm/precompiles/multicurrency.rs @@ -268,7 +268,7 @@ where let mut input = handle.read_input()?; input.expect_arguments(3)?; - let origin: H160 = handle.context().caller.into(); + let origin: H160 = handle.context().caller; let from: H160 = input.read::
()?.into(); let to: H160 = input.read::
()?.into(); let amount = input.read::()?; From 3dc15f340708c3f752537f54c3708f788060fca8 Mon Sep 17 00:00:00 2001 From: mrq1911 <2580779+mrq1911@users.noreply.github.com> Date: Tue, 10 Sep 2024 02:25:53 +0200 Subject: [PATCH 10/57] Apply suggestions from code review Co-authored-by: Daniel Moka --- pallets/asset-registry/src/tests/evm.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pallets/asset-registry/src/tests/evm.rs b/pallets/asset-registry/src/tests/evm.rs index bc82418be..ab74dd6a9 100644 --- a/pallets/asset-registry/src/tests/evm.rs +++ b/pallets/asset-registry/src/tests/evm.rs @@ -47,7 +47,7 @@ fn ec20_trait_should_return_contract_address() { } #[test] -fn return_none_when_asset_is_not_erc20() { +fn contract_address_should_be_none_when_asset_is_not_erc20() { ExtBuilder::default().build().execute_with(|| { let _ = with_transaction(|| { // Arrange @@ -72,7 +72,7 @@ fn return_none_when_asset_is_not_erc20() { } #[test] -fn return_zero_when_erc20_has_wrong_location() { +fn contract_address_should_be_zero_when_erc20_has_wrong_location() { let locations = vec![ None, Some(AssetLocation(MultiLocation::new( From ed6e502b52b26e93ebf6d42798f0a919de9320f3 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 02:32:41 +0200 Subject: [PATCH 11/57] test disapprove --- integration-tests/src/evm.rs | 44 ++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index cdeee026c..d9db0e46b 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -992,6 +992,50 @@ mod currency_precompile { }); } + #[test] + fn precompile_for_currency_allowance_should_return_zero_for_disapproved_contract() { + TestNet::reset(); + + Hydra::execute_with(|| { + //Arrange + assert_ok!(EVMAccounts::approve_contract( + hydradx_runtime::RuntimeOrigin::root(), + evm_address(), + )); + let data = EvmDataWriter::new_with_selector(Function::Allowance) + .write(Address::from(evm_address2())) + .write(Address::from(evm_address())) + .build(); + + let mut handle = MockHandle { + input: data, + context: Context { + address: native_asset_ethereum_address(), + caller: evm_address(), + apparent_value: U256::from(0), + }, + code_address: native_asset_ethereum_address(), + is_static: true, + }; + + //Act + assert_ok!(EVMAccounts::disapprove_contract( + hydradx_runtime::RuntimeOrigin::root(), + evm_address(), + )); + let result = CurrencyPrecompile::execute(&mut handle); + + //Assert + assert_eq!( + result, + Ok(PrecompileOutput { + exit_status: ExitSucceed::Returned, + output: hex!["0000000000000000000000000000000000000000000000000000000000000000"].to_vec() + }) + ); + }); + } + #[test] fn precompile_for_transfer_from_should_fail_for_not_approved_contract() { TestNet::reset(); From c1b3db223dd6414866a45ae6c4557cbd8adfcaed Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 02:32:56 +0200 Subject: [PATCH 12/57] fixed evm account readme --- pallets/evm-accounts/README.md | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/pallets/evm-accounts/README.md b/pallets/evm-accounts/README.md index 8e2a80b72..7d92cff44 100644 --- a/pallets/evm-accounts/README.md +++ b/pallets/evm-accounts/README.md @@ -2,17 +2,20 @@ ## Terminology -* **Truncated address:** * A substrate address created from an EVM address by prefixing it with "ETH\0" and appending with eight 0 bytes. +* **Truncated address:** * A substrate address created from an EVM address by prefixing it with "ETH\0" and appending + with eight 0 bytes. * **Full Substrate address:** * Original 32 bytes long native address (not a truncated address). * **EVM address:** * First 20 bytes of a Substrate address. ## Overview -The pallet allows users to bind their Substrate account to the EVM address and to grant a permission to deploy smart contracts. +The pallet allows users to bind their Substrate account to the EVM address and to grant a permission to deploy smart +contracts. The purpose of this pallet is to make interaction with the EVM easier. Binding an address is not necessary for interacting with the EVM. ### Binding + Without binding, we are unable to get the original Substrate address from the EVM address inside of the EVM. Inside of the EVM, we have access only to the EVM address (first 20 bytes of a Substrate account). In this case we create and use a truncated version of the original Substrate address that called the EVM. @@ -22,13 +25,22 @@ With binding, we store the last 12 bytes of the Substrate address. Then we can g Substrate address by concatenating these 12 bytes stored in the storage to the EVM address. ### Smart contract deployment + This pallet also allows granting a permission to deploy smart contracts. `ControllerOrigin` can add this permission to EVM addresses. The list of whitelisted accounts is stored in the storage of this pallet. +### Approving smart contracts + +This pallet is also used to control which contracts are allowed to manage balances and tokens. +`ApprovedContract` storage is used by the currencies precompile to determine whenever contract is allowed to transfer or +not. + ### Dispatchable Functions * `bind_evm_address` - Binds a Substrate address to EVM address. * `add_contract_deployer` - Adds a permission to deploy smart contracts. * `remove_contract_deployer` - Removes a permission of whitelisted address to deploy smart contracts. * `renounce_contract_deployer` - Renounce caller's permission to deploy smart contracts. +* `approve_contract` - Approves contract address to manage balances. +* `disapprove_contract` - Disapproves contract address to manage balances. From 3c0ff3dab46fea51050393a06d624191203338af Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 02:36:12 +0200 Subject: [PATCH 13/57] fmt --- integration-tests/src/erc20.rs | 2 +- pallets/currencies/src/lib.rs | 2 +- runtime/hydradx/src/evm/erc20_currency.rs | 4 ++-- runtime/hydradx/src/evm/executor.rs | 8 ++------ 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs index 888b4c918..95c9a59b5 100644 --- a/integration-tests/src/erc20.rs +++ b/integration-tests/src/erc20.rs @@ -2,7 +2,6 @@ use crate::evm::MockHandle; use crate::polkadot_test_net::*; use crate::utils::contracts::*; use core::panic; -use std::fmt::Write; use ethabi::ethereum_types::BigEndianHash; use fp_evm::ExitReason::Succeed; use fp_evm::PrecompileSet; @@ -33,6 +32,7 @@ use sp_core::keccak_256; use sp_core::Encode; use sp_core::{H256, U256}; use sp_runtime::{Permill, TransactionOutcome}; +use std::fmt::Write; use xcm_emulator::TestExt; pub fn deployer() -> EvmAddress { diff --git a/pallets/currencies/src/lib.rs b/pallets/currencies/src/lib.rs index b3135ac7c..2fbcc5b6b 100644 --- a/pallets/currencies/src/lib.rs +++ b/pallets/currencies/src/lib.rs @@ -59,12 +59,12 @@ use orml_traits::{ LockIdentifier, MultiCurrency, MultiCurrencyExtended, MultiLockableCurrency, MultiReservableCurrency, NamedBasicReservableCurrency, NamedMultiReservableCurrency, }; -use sp_std::vec::Vec; use orml_utilities::with_transaction_result; use sp_runtime::{ traits::{CheckedSub, MaybeSerializeDeserialize, StaticLookup, Zero}, DispatchError, DispatchResult, }; +use sp_std::vec::Vec; use sp_std::{fmt::Debug, marker, result}; pub mod fungibles; diff --git a/runtime/hydradx/src/evm/erc20_currency.rs b/runtime/hydradx/src/evm/erc20_currency.rs index c603d4ee9..11a5ba48a 100644 --- a/runtime/hydradx/src/evm/erc20_currency.rs +++ b/runtime/hydradx/src/evm/erc20_currency.rs @@ -10,13 +10,13 @@ use num_enum::{IntoPrimitive, TryFromPrimitive}; use orml_traits::MultiCurrency; use pallet_currencies::{Config, Error}; use primitives::Balance; +use scale_info::prelude::format; use sp_core::crypto::AccountId32; use sp_core::{H160, H256, U256}; use sp_runtime::traits::{CheckedConversion, Zero}; use sp_runtime::{DispatchError, SaturatedConversion}; -use sp_std::vec::Vec; -use scale_info::prelude::format; use sp_std::boxed::Box; +use sp_std::vec::Vec; #[module_evm_utility_macro::generate_function_selector] #[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index d29307535..9efd5857d 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -9,9 +9,8 @@ use pallet_evm::runner::stack::SubstrateStackState; use pallet_evm::{AddressMapping, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; -use sp_std::vec::Vec; use sp_std::vec; - +use sp_std::vec::Vec; pub struct Executor(sp_std::marker::PhantomData); @@ -33,10 +32,7 @@ where ) -> (ExitReason, Vec), { let gas_price = U256::one(); - let vicinity = Vicinity { - gas_price, - origin - }; + let vicinity = Vicinity { gas_price, origin }; let config = ::config(); let precompiles = T::PrecompilesValue::get(); From a36239403eb2960c302c5f7198b89b454ba7a2d6 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 02:44:31 +0200 Subject: [PATCH 14/57] cleaned up some deps --- Cargo.lock | 38 ++++++++++++---------------- Cargo.toml | 2 ++ integration-tests/Cargo.toml | 6 ++--- node/Cargo.toml | 26 +++++++++---------- pallets/claims/Cargo.toml | 40 +++++++++++++++--------------- pallets/evm-accounts/Cargo.toml | 2 +- pallets/genesis-history/Cargo.toml | 4 +-- pallets/referrals/Cargo.toml | 28 ++++++++++----------- primitives/Cargo.toml | 4 +-- runtime/hydradx/Cargo.toml | 4 +-- 10 files changed, 75 insertions(+), 79 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a45c26f9..908714a40 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4559,12 +4559,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - [[package]] name = "hex-literal" version = "0.4.1" @@ -4747,7 +4741,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "futures", - "hex-literal 0.3.4", + "hex-literal", "hydra-dx-build-script-utils", "hydradx-runtime", "jsonrpsee 0.20.3", @@ -4884,7 +4878,7 @@ dependencies = [ "frame-system-rpc-runtime-api", "frame-try-runtime", "hex", - "hex-literal 0.4.1", + "hex-literal", "hydra-dx-math", "hydradx-adapters", "hydradx-traits", @@ -7430,7 +7424,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.4.1", + "hex-literal", "hydradx-traits", "log", "orml-tokens", @@ -7750,7 +7744,7 @@ dependencies = [ "frame-support", "frame-system", "hex", - "hex-literal 0.3.4", + "hex-literal", "lazy_static", "pallet-balances", "parity-scale-codec", @@ -8136,7 +8130,7 @@ dependencies = [ "frame-system", "hash-db", "hex", - "hex-literal 0.4.1", + "hex-literal", "impl-trait-for-tuples", "log", "parity-scale-codec", @@ -8155,7 +8149,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.4.1", + "hex-literal", "hydradx-traits", "orml-tokens", "orml-traits", @@ -8213,7 +8207,7 @@ dependencies = [ "fp-evm", "frame-support", "frame-system", - "hex-literal 0.4.1", + "hex-literal", "libsecp256k1", "log", "num_enum 0.5.11", @@ -8290,7 +8284,7 @@ dependencies = [ "derive_more", "frame-support", "frame-system", - "hex-literal 0.4.1", + "hex-literal", "log", "parity-scale-codec", "scale-info", @@ -8826,7 +8820,7 @@ dependencies = [ "frame-benchmarking", "frame-support", "frame-system", - "hex-literal 0.3.4", + "hex-literal", "hydra-dx-math", "hydradx-traits", "orml-tokens", @@ -10514,7 +10508,7 @@ version = "7.0.0" source = "git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2#e73d252e3e13b27a1127bde9a7c47febf70cc9ab" dependencies = [ "bitvec", - "hex-literal 0.4.1", + "hex-literal", "log", "parity-scale-codec", "polkadot-core-primitives", @@ -10694,7 +10688,7 @@ dependencies = [ "frame-system", "frame-system-rpc-runtime-api", "futures", - "hex-literal 0.4.1", + "hex-literal", "is_executable", "kvdb", "kvdb-rocksdb", @@ -10916,7 +10910,7 @@ dependencies = [ "frame-support", "frame-system", "hex", - "hex-literal 0.4.1", + "hex-literal", "impl-trait-for-tuples", "log", "num_enum 0.5.11", @@ -11035,7 +11029,7 @@ name = "primitives" version = "6.1.0" dependencies = [ "frame-support", - "hex-literal 0.3.4", + "hex-literal", "parity-scale-codec", "polkadot-primitives", "scale-info", @@ -11709,7 +11703,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal 0.4.1", + "hex-literal", "log", "pallet-asset-rate", "pallet-authority-discovery", @@ -11887,7 +11881,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "hex", - "hex-literal 0.4.1", + "hex-literal", "hydradx-adapters", "hydradx-runtime", "hydradx-traits", @@ -16729,7 +16723,7 @@ dependencies = [ "frame-system-benchmarking", "frame-system-rpc-runtime-api", "frame-try-runtime", - "hex-literal 0.4.1", + "hex-literal", "log", "pallet-asset-rate", "pallet-authority-discovery", diff --git a/Cargo.toml b/Cargo.toml index 388335da1..d6b7e7ca6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -54,12 +54,14 @@ async-trait = "0.1" futures = "0.3.25" hex-literal = "0.4.1" paste = "1.0.6" +serde_json = "1.0.117" slices = "0.2.0" derive_more = "0.99" affix = "0.1.2" similar-asserts = "1.1.0" impl-trait-for-tuples = "0.2.1" environmental = { version = "1.1.2", default-features = false } +ethabi = { version = "18.0.0", default-features = false } hex = { version = "0.4.3", default-features = false } sha3 = { version = "0.10", default-features = false } serde = { version = "1.0.101", default-features = false } diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 06ce92007..1e63147da 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -132,9 +132,9 @@ polkadot-service = { workspace = true, features = ["full-node"] } polkadot-runtime-parachains = { workspace = true } rococo-runtime = { workspace = true } -ethabi = { version = "18.0.0", default-features = false } -serde_json = "1.0.117" -hex = { version = "0.4.3", default-features = false } +ethabi = { workspace = true } +serde_json = { workspace = true } +hex = { workspace = true } [dev-dependencies] pretty_assertions = "1.2.1" diff --git a/node/Cargo.toml b/node/Cargo.toml index 42a5c68e3..b17376d02 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -19,22 +19,22 @@ hydra-dx-build-script-utils = { workspace = true } [dependencies] codec = { package = "parity-scale-codec", version = "3.4.0" } -hex-literal = "0.3.4" +hex-literal = { workspace = true } jsonrpsee = { version = "0.20.3", features = ["server", "macros"] } -log = "0.4.17" +log = { workspace = true } serde = { version = "1.0.136", features = ["derive"] } -serde_json = "1.0.85" -clap = { version = "4.1.8", features = [ "derive" ] } -futures = "0.3.21" -async-trait = "0.1" +serde_json = { workspace = true } +clap = { version = "4.1.8", features = ["derive"] } +futures = { workspace = true } +async-trait = { workspace = true } # local dependencies -hydradx-runtime = { workspace = true , features = ["std"] } +hydradx-runtime = { workspace = true, features = ["std"] } primitives = { workspace = true } # Substrate dependencies frame-benchmarking = { workspace = true } -frame-benchmarking-cli = { workspace = true , optional = true } +frame-benchmarking-cli = { workspace = true, optional = true } pallet-transaction-payment-rpc = { workspace = true } sc-basic-authorship = { workspace = true } sc-chain-spec = { workspace = true } @@ -118,13 +118,13 @@ fp-consensus = { workspace = true } [features] default = [ - "frame-benchmarking-cli", + "frame-benchmarking-cli", ] runtime-benchmarks = [ - "hydradx-runtime/runtime-benchmarks", - "frame-benchmarking-cli", - "polkadot-service/runtime-benchmarks", - "polkadot-cli/runtime-benchmarks", + "hydradx-runtime/runtime-benchmarks", + "frame-benchmarking-cli", + "polkadot-service/runtime-benchmarks", + "polkadot-cli/runtime-benchmarks", ] try-runtime = [ "hydradx-runtime/try-runtime", diff --git a/pallets/claims/Cargo.toml b/pallets/claims/Cargo.toml index 50524f836..0ba12f06d 100644 --- a/pallets/claims/Cargo.toml +++ b/pallets/claims/Cargo.toml @@ -13,15 +13,15 @@ targets = ['x86_64-unknown-linux-gnu'] [dependencies] scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } -codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } -serde = { version = '1.0.136', default-features = false, features = ['derive']} -hex = {default-features = false, version = "0.4.3"} -hex-literal = '0.3.4' -lazy_static = {features = ['spin_no_std'], version = "1.4.0"} -rustc-hex = {version = '2.1.0', default-features = false} +codec = { workspace = true } +serde = { version = '1.0.136', default-features = false, features = ['derive'] } +hex = { default-features = false, version = "0.4.3" } +hex-literal = { workspace = true } +lazy_static = { features = ['spin_no_std'], version = "1.4.0" } +rustc-hex = { version = '2.1.0', default-features = false } # Substrate dependencies -frame-benchmarking = { workspace = true, optional = true} +frame-benchmarking = { workspace = true, optional = true } frame-support = { workspace = true } frame-system = { workspace = true } sp-io = { workspace = true } @@ -38,19 +38,19 @@ sp-core = { workspace = true } [features] default = ['std'] runtime-benchmarks = [ - "frame-benchmarking", - "frame-support/runtime-benchmarks", - "frame-system/runtime-benchmarks", + "frame-benchmarking", + "frame-support/runtime-benchmarks", + "frame-system/runtime-benchmarks", ] std = [ - 'codec/std', - 'frame-support/std', - 'frame-system/std', - 'primitives/std', - 'rustc-hex/std', - 'serde/std', - 'scale-info/std', - 'pallet-balances/std', - 'frame-benchmarking/std' + 'codec/std', + 'frame-support/std', + 'frame-system/std', + 'primitives/std', + 'rustc-hex/std', + 'serde/std', + 'scale-info/std', + 'pallet-balances/std', + 'frame-benchmarking/std' ] -try-runtime = [ "frame-support/try-runtime" ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/evm-accounts/Cargo.toml b/pallets/evm-accounts/Cargo.toml index c5ba97990..f51087d08 100644 --- a/pallets/evm-accounts/Cargo.toml +++ b/pallets/evm-accounts/Cargo.toml @@ -34,7 +34,7 @@ frame-benchmarking = { workspace = true } orml-tokens = { workspace = true } orml-traits = { workspace = true } test-utils = { workspace = true } -hex-literal = "0.4.1" +hex-literal = { workspace = true } [features] default = ["std"] diff --git a/pallets/genesis-history/Cargo.toml b/pallets/genesis-history/Cargo.toml index 9975b0a38..21addd74f 100644 --- a/pallets/genesis-history/Cargo.toml +++ b/pallets/genesis-history/Cargo.toml @@ -24,7 +24,7 @@ sp-io = { workspace = true } sp-runtime = { workspace = true } sp-std = { workspace = true } sp-core = { workspace = true } -hex-literal = "0.4.1" +hex-literal = { workspace = true } [features] default = ['std'] @@ -35,4 +35,4 @@ std = [ 'serde/std', 'scale-info/std', ] -try-runtime = [ "frame-support/try-runtime" ] +try-runtime = ["frame-support/try-runtime"] diff --git a/pallets/referrals/Cargo.toml b/pallets/referrals/Cargo.toml index 981f0829e..352035615 100644 --- a/pallets/referrals/Cargo.toml +++ b/pallets/referrals/Cargo.toml @@ -13,7 +13,7 @@ readme = "README.md" targets = ["x86_64-unknown-linux-gnu"] [dependencies] -hex-literal = "0.3.4" +hex-literal = { workspace = true } # parity scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } @@ -45,20 +45,20 @@ orml-tokens = { workspace = true } [features] default = ["std"] std = [ - "codec/std", - "sp-runtime/std", - "sp-std/std", - "frame-support/std", - "frame-system/std", - "scale-info/std", - "sp-core/std", - "sp-io/std", - "orml-tokens/std", - "frame-benchmarking/std" + "codec/std", + "sp-runtime/std", + "sp-std/std", + "frame-support/std", + "frame-system/std", + "scale-info/std", + "sp-core/std", + "sp-io/std", + "orml-tokens/std", + "frame-benchmarking/std" ] runtime-benchmarks = [ - "frame-benchmarking/runtime-benchmarks", - "sp-io", + "frame-benchmarking/runtime-benchmarks", + "sp-io", ] -try-runtime = [ "frame-support/try-runtime" ] +try-runtime = ["frame-support/try-runtime"] diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index d703abc71..f1d5a7150 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" repository = "https://github.com/galacticcouncil/HydraDX-node" [dependencies] -codec = { default-features = false, features = ["derive"], package = "parity-scale-codec", version = "3.4.0" } +codec = { workspace = true } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } serde = { features = ["derive"], optional = true, version = "1.0.136" } -hex-literal = { version = '0.3.4' } +hex-literal = { workspace = true } static_assertions = "1.1.0" # Substrate dependencies diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 949cbb28d..f0ca841c7 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -13,9 +13,9 @@ targets = ["x86_64-unknown-linux-gnu"] substrate-wasm-builder = { workspace = true } [dependencies] -hex-literal = "0.4.1" +hex-literal = { workspace = true } serde = { features = ["derive"], optional = true, version = "1.0.136" } -codec = { package = "parity-scale-codec", version = "3.4.0", default-features = false, features = ["derive"] } +codec = { workspace = true } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } smallvec = "1.9.0" log = { workspace = true } From e0bf29a2889ff4e90d641370f9aa19153ff46317 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 02:47:33 +0200 Subject: [PATCH 15/57] hydradx traits 3.6 --- Cargo.lock | 2 +- traits/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 908714a40..dbf5807eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4991,7 +4991,7 @@ dependencies = [ [[package]] name = "hydradx-traits" -version = "3.5.0" +version = "3.6.0" dependencies = [ "frame-support", "impl-trait-for-tuples", diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 2a08d0e31..e815c38ba 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-traits" -version = "3.5.0" +version = "3.6.0" description = "Shared traits" authors = ["GalacticCouncil"] edition = "2021" From 0616d1521240734835859e514afc3dedc68e3fb6 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 08:12:14 +0200 Subject: [PATCH 16/57] bumped version of other modified crates --- Cargo.lock | 8 ++++---- node/Cargo.toml | 2 +- pallets/claims/Cargo.toml | 2 +- pallets/genesis-history/Cargo.toml | 2 +- pallets/referrals/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbf5807eb..408a802c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4711,7 +4711,7 @@ dependencies = [ [[package]] name = "hydradx" -version = "13.1.2" +version = "13.1.3" dependencies = [ "async-trait", "clap 4.5.4", @@ -7738,7 +7738,7 @@ dependencies = [ [[package]] name = "pallet-claims" -version = "3.4.9" +version = "3.4.10" dependencies = [ "frame-benchmarking", "frame-support", @@ -8279,7 +8279,7 @@ dependencies = [ [[package]] name = "pallet-genesis-history" -version = "2.1.2" +version = "2.1.3" dependencies = [ "derive_more", "frame-support", @@ -8815,7 +8815,7 @@ dependencies = [ [[package]] name = "pallet-referrals" -version = "1.2.5" +version = "1.2.6" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/node/Cargo.toml b/node/Cargo.toml index b17376d02..2aa275888 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx" -version = "13.1.2" +version = "13.1.3" description = "Hydration node" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/claims/Cargo.toml b/pallets/claims/Cargo.toml index 0ba12f06d..b70f9e54d 100644 --- a/pallets/claims/Cargo.toml +++ b/pallets/claims/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-claims' -version = '3.4.9' +version = '3.4.10' description = 'HydraDX Claims Module' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/genesis-history/Cargo.toml b/pallets/genesis-history/Cargo.toml index 21addd74f..3ca69b32f 100644 --- a/pallets/genesis-history/Cargo.toml +++ b/pallets/genesis-history/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-genesis-history" -version = "2.1.2" +version = "2.1.3" description = "Keeping track of the past chain generations." authors = ["GalacticCouncil "] edition = "2021" diff --git a/pallets/referrals/Cargo.toml b/pallets/referrals/Cargo.toml index 352035615..6a7cb2d6d 100644 --- a/pallets/referrals/Cargo.toml +++ b/pallets/referrals/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-referrals" -version = "1.2.5" +version = "1.2.6" authors = ['GalacticCouncil'] edition = "2021" license = "Apache-2.0" From 60619a5e6508395292fe27ad1257cc4991aa9d93 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 08:15:54 +0200 Subject: [PATCH 17/57] faster version check --- scripts/list_crate_updates.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/list_crate_updates.sh b/scripts/list_crate_updates.sh index b231da822..4a01c53e4 100755 --- a/scripts/list_crate_updates.sh +++ b/scripts/list_crate_updates.sh @@ -3,6 +3,7 @@ # this script is used in github workflow to print an overview of crates and its version set -ex +alias cargo=cargo --config net.git-fetch-with-cli=true RUNTIME_CRATE="hydradx-runtime" PROJECT_PATH=$(cargo locate-project --workspace --message-format plain) From 7fba7cde215e6fc187ae96a9088434b56f537b5c Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 08:30:14 +0200 Subject: [PATCH 18/57] fix alias --- scripts/list_crate_updates.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/list_crate_updates.sh b/scripts/list_crate_updates.sh index 4a01c53e4..3f3251294 100755 --- a/scripts/list_crate_updates.sh +++ b/scripts/list_crate_updates.sh @@ -3,7 +3,8 @@ # this script is used in github workflow to print an overview of crates and its version set -ex -alias cargo=cargo --config net.git-fetch-with-cli=true +shopt -s expand_aliases +alias cargo="cargo --config net.git-fetch-with-cli=true" RUNTIME_CRATE="hydradx-runtime" PROJECT_PATH=$(cargo locate-project --workspace --message-format plain) From 1c25a4752a3cd3a75f9acc0bd89c8afa9a64ac7e Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 08:37:16 +0200 Subject: [PATCH 19/57] update benchmark of transfer for erc20 --- Cargo.lock | 1 + runtime/hydradx/Cargo.toml | 1 + .../hydradx/src/benchmarking/currencies.rs | 93 ++++++++++++++++++- 3 files changed, 92 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 408a802c7..4e9fb92f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4965,6 +4965,7 @@ dependencies = [ "primitives", "scale-info", "serde", + "serde_json", "smallvec", "sp-api", "sp-block-builder", diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index f0ca841c7..bf0bed90c 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -163,6 +163,7 @@ precompile-utils = { workspace = true } module-evm-utility-macro = { workspace = true } ethabi = { version = "18.0.0", default-features = false } hex = { version = "0.4.3", default-features = false } +serde_json = "1.0.117" [features] default = ["std"] diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index caeab8c7c..9b34977a7 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -1,4 +1,7 @@ -use crate::{AccountId, Amount, AssetId, Balance, Currencies, NativeAssetId, Runtime}; +use std::fs; +use evm::ExitReason; +use fp_rpc::runtime_decl_for_ethereum_runtime_rpc_api::EthereumRuntimeRPCApi; +use crate::{AccountId, Amount, AssetId, Balance, Currencies, EVMAccounts, NativeAssetId, Runtime}; use primitives::constants::currency::NATIVE_EXISTENTIAL_DEPOSIT; use sp_std::prelude::*; @@ -10,10 +13,18 @@ use sp_runtime::SaturatedConversion; use frame_benchmarking::BenchmarkError; use frame_support::assert_ok; +use hex_literal::hex; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrency; use orml_traits::MultiCurrencyExtended; +use polkadot_xcm::v3::Junction::AccountKey20; +use polkadot_xcm::v3::Junctions::X1; +use polkadot_xcm::v3::MultiLocation; +use primitive_types::{H160, U256}; +use hydradx_traits::evm::{CallContext, ERC20, EvmAddress, InspectEvmAccounts}; +use crate::evm::Erc20Currency; +use crate::evm::precompiles::erc20_mapping::{Erc20Mapping, HydraErc20Mapping}; use super::*; @@ -40,8 +51,8 @@ runtime_benchmarks! { transfer_non_native_currency { let amount: Balance = 1_000 * BSX; let from: AccountId = whitelisted_caller(); - let asset_id = register_asset(b"TST".to_vec(), 1u128).map_err(|_| BenchmarkError::Stop("Failed to register asset"))?; - set_balance(asset_id, &from, amount); + let contract_address = deploy_token_contract(from.clone()); + let asset_id = bind_erc20(contract_address); let to: AccountId = account("to", 0, SEED); let to_lookup = lookup_of_account(to.clone()); @@ -136,3 +147,79 @@ mod tests { impl_benchmark_test_suite!(new_test_ext(),); } + +//TODO: refactor these to common +pub fn get_contract_bytecode(name: &str) -> Vec { + let path = format!( + "../../scripts/test-contracts/artifacts/contracts/{}.sol/{}.json", + name, name + ); + let str = fs::read_to_string(path).unwrap(); + let json: serde_json::Value = serde_json::from_str(&str).unwrap(); + let code = json.get("bytecode").unwrap().as_str().unwrap(); + hex::decode(&code[2..]).unwrap() +} + +pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { + assert_ok!(EVMAccounts::add_contract_deployer( + RawOrigin::Root.into(), + deployer, + )); + + let info = crate::Runtime::create( + deployer, + code.clone(), + U256::zero(), + U256::from(2000000u64), + None, + None, + None, + false, + None, + ); + + let address = match info.clone().unwrap().exit_reason { + ExitReason::Succeed(_) => info.unwrap().value, + reason => panic!("{:?}", reason), + }; + + let deployed = crate::Runtime::account_code_at(address.clone()); + assert_ne!(deployed, vec![0; deployed.len()]); + address +} + +pub fn deploy_contract(name: &str, deployer: EvmAddress) -> EvmAddress { + deploy_contract_code(get_contract_bytecode(name), deployer) +} + +pub fn deployer(who: AccountId) -> EvmAddress { + EVMAccounts::evm_address(&Into::::into(who)) +} + +pub fn deploy_token_contract(who: AccountId) -> EvmAddress { + deploy_contract("HydraToken", deployer(who)) +} + +fn bind_erc20(contract: EvmAddress) -> AssetId { + let token = CallContext::new_view(contract); + let asset = with_transaction(|| { + TransactionOutcome::Commit(AssetRegistry::register_sufficient_asset( + None, + Some(Erc20Currency::::name(token).unwrap().try_into().unwrap()), + AssetKind::Erc20, + 1, + Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), + Some(Erc20Currency::::decimals(token).unwrap().try_into().unwrap()), + Some(AssetLocation(MultiLocation::new( + 0, + X1(AccountKey20 { + key: contract.into(), + network: None, + }), + ))), + None, + )) + }); + asset.unwrap() +} + From 1fad3eac2cbaca31f44db10575dd62440df5b492 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 08:45:10 +0200 Subject: [PATCH 20/57] make sure xtoken transfer doesnt work --- integration-tests/src/cross_chain_transfer.rs | 24 ++++++++++ integration-tests/src/erc20.rs | 46 +++++++++---------- 2 files changed, 47 insertions(+), 23 deletions(-) diff --git a/integration-tests/src/cross_chain_transfer.rs b/integration-tests/src/cross_chain_transfer.rs index 6863567fd..08ebed99e 100644 --- a/integration-tests/src/cross_chain_transfer.rs +++ b/integration-tests/src/cross_chain_transfer.rs @@ -1,4 +1,6 @@ #![cfg(test)] +use crate::erc20::bind_erc20; +use crate::erc20::deploy_token_contract; use crate::polkadot_test_net::Rococo; use crate::polkadot_test_net::*; @@ -14,6 +16,7 @@ use frame_support::weights::Weight; use hydradx_runtime::AssetRegistry; use hydradx_traits::{registry::Mutate, AssetKind, Create}; use orml_traits::currency::MultiCurrency; +use orml_xtokens::Error::AssetHasNoReserve; use polkadot_xcm::opaque::v3::{ Junction, Junctions::{X1, X2}, @@ -110,6 +113,27 @@ fn rococo_should_receive_asset_when_sent_from_hydra() { }); } +#[test] +fn xtoken_transfer_of_erc20_should_fail() { + //Arrange + Hydra::execute_with(|| { + // Arrange + let asset = bind_erc20(deploy_token_contract()); + + //Act & Assert + assert_noop!( + hydradx_runtime::XTokens::transfer( + hydradx_runtime::RuntimeOrigin::signed(ALICE.into()), + asset, + 3 * UNITS, + Box::new(MultiLocation::new(1, X1(Junction::AccountId32 { id: BOB, network: None })).into_versioned()), + WeightLimit::Unlimited, + ), + orml_xtokens::Error::::AssetHasNoReserve + ); + }); +} + #[test] fn hydra_should_receive_asset_when_transferred_from_acala() { // Arrange diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs index 95c9a59b5..7c9190018 100644 --- a/integration-tests/src/erc20.rs +++ b/integration-tests/src/erc20.rs @@ -43,6 +43,29 @@ pub fn deploy_token_contract() -> EvmAddress { deploy_contract("HydraToken", deployer()) } +pub fn bind_erc20(contract: EvmAddress) -> AssetId { + let token = CallContext::new_view(contract); + let asset = with_transaction(|| { + TransactionOutcome::Commit(AssetRegistry::register_sufficient_asset( + None, + Some(Erc20Currency::::name(token).unwrap().try_into().unwrap()), + AssetKind::Erc20, + 1, + Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), + Some(Erc20Currency::::decimals(token).unwrap()), + Some(AssetLocation(MultiLocation::new( + 0, + X1(AccountKey20 { + key: contract.into(), + network: None, + }), + ))), + None, + )) + }); + asset.unwrap() +} + #[test] fn executor_view_should_return_something() { TestNet::reset(); @@ -273,29 +296,6 @@ fn account_should_receive_tokens() { }); } -fn bind_erc20(contract: EvmAddress) -> AssetId { - let token = CallContext::new_view(contract); - let asset = with_transaction(|| { - TransactionOutcome::Commit(AssetRegistry::register_sufficient_asset( - None, - Some(Erc20Currency::::name(token).unwrap().try_into().unwrap()), - AssetKind::Erc20, - 1, - Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), - Some(Erc20Currency::::decimals(token).unwrap()), - Some(AssetLocation(MultiLocation::new( - 0, - X1(AccountKey20 { - key: contract.into(), - network: None, - }), - ))), - None, - )) - }); - asset.unwrap() -} - #[test] fn bound_erc20_should_have_issuance() { TestNet::reset(); From 0cec4749f6ae13e55ff739c3a22cef888c8cd785 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 08:48:51 +0200 Subject: [PATCH 21/57] removed unused import --- integration-tests/src/cross_chain_transfer.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/integration-tests/src/cross_chain_transfer.rs b/integration-tests/src/cross_chain_transfer.rs index 08ebed99e..0c50dcc6f 100644 --- a/integration-tests/src/cross_chain_transfer.rs +++ b/integration-tests/src/cross_chain_transfer.rs @@ -16,7 +16,6 @@ use frame_support::weights::Weight; use hydradx_runtime::AssetRegistry; use hydradx_traits::{registry::Mutate, AssetKind, Create}; use orml_traits::currency::MultiCurrency; -use orml_xtokens::Error::AssetHasNoReserve; use polkadot_xcm::opaque::v3::{ Junction, Junctions::{X1, X2}, From 1a038f03286b25e6ba443c9e1487e52554254dd0 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 09:29:00 +0200 Subject: [PATCH 22/57] make it build by fixing package declarations --- runtime/hydradx/Cargo.toml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index bf0bed90c..df0097e6e 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -161,9 +161,9 @@ pallet-evm-precompile-blake2 = { workspace = true } pallet-evm-precompile-call-permit = { workspace = true } precompile-utils = { workspace = true } module-evm-utility-macro = { workspace = true } -ethabi = { version = "18.0.0", default-features = false } -hex = { version = "0.4.3", default-features = false } -serde_json = "1.0.117" +ethabi = { workspace = true } +hex = { workspace = true } +serde_json = { version = "1.0.117",default-features = false } [features] default = ["std"] From 09e29a7af96216e2c2514a18390d37d655179d38 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 09:52:16 +0200 Subject: [PATCH 23/57] rebenchmark pallet currencies --- .../hydradx/src/benchmarking/currencies.rs | 1 - .../hydradx/src/weights/pallet_currencies.rs | 40 ++++++++++--------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index 9b34977a7..215437f13 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -148,7 +148,6 @@ mod tests { impl_benchmark_test_suite!(new_test_ext(),); } -//TODO: refactor these to common pub fn get_contract_bytecode(name: &str) -> Vec { let path = format!( "../../scripts/test-contracts/artifacts/contracts/{}.sol/{}.json", diff --git a/runtime/hydradx/src/weights/pallet_currencies.rs b/runtime/hydradx/src/weights/pallet_currencies.rs index 2b2a6579b..dd69f825d 100644 --- a/runtime/hydradx/src/weights/pallet_currencies.rs +++ b/runtime/hydradx/src/weights/pallet_currencies.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_currencies` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -30,7 +30,7 @@ // pallet // --wasm-execution=compiled // --pallet -// * +// pallet-currencies // --extrinsic // * // --heap-pages @@ -41,7 +41,7 @@ // 20 // --template=scripts/pallet-weight-template.hbs // --output -// weights/ +// currencies.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,6 +57,8 @@ pub struct WeightInfo(PhantomData); /// Weights for `pallet_currencies` using the HydraDX node and recommended hardware. pub struct HydraWeight(PhantomData); impl pallet_currencies::WeightInfo for HydraWeight { + /// Storage: `Router::SkipEd` (r:1 w:0) + /// Proof: `Router::SkipEd` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) /// Storage: `Duster::AccountBlacklist` (r:1 w:0) /// Proof: `Duster::AccountBlacklist` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) /// Storage: `AssetRegistry::BannedAssets` (r:1 w:0) @@ -73,21 +75,21 @@ impl pallet_currencies::WeightInfo for HydraWeight { /// Proof: `MultiTransactionPayment::AcceptedCurrencies` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) fn transfer_non_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `2649` + // Measured: `2853` // Estimated: `6156` - // Minimum execution time: 89_816_000 picoseconds. - Weight::from_parts(90_275_000, 6156) - .saturating_add(T::DbWeight::get().reads(8_u64)) + // Minimum execution time: 100_420_000 picoseconds. + Weight::from_parts(101_470_000, 6156) + .saturating_add(T::DbWeight::get().reads(9_u64)) .saturating_add(T::DbWeight::get().writes(4_u64)) } /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn transfer_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `1642` + // Measured: `1638` // Estimated: `3593` - // Minimum execution time: 70_873_000 picoseconds. - Weight::from_parts(71_750_000, 3593) + // Minimum execution time: 74_720_000 picoseconds. + Weight::from_parts(75_319_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -107,10 +109,10 @@ impl pallet_currencies::WeightInfo for HydraWeight { /// Proof: `MultiTransactionPayment::AcceptedCurrencies` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) fn update_balance_non_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `2213` + // Measured: `2209` // Estimated: `3593` - // Minimum execution time: 62_719_000 picoseconds. - Weight::from_parts(63_335_000, 3593) + // Minimum execution time: 65_957_000 picoseconds. + Weight::from_parts(66_856_000, 3593) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -118,10 +120,10 @@ impl pallet_currencies::WeightInfo for HydraWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn update_balance_native_currency_creating() -> Weight { // Proof Size summary in bytes: - // Measured: `1502` + // Measured: `1498` // Estimated: `3593` - // Minimum execution time: 38_419_000 picoseconds. - Weight::from_parts(39_090_000, 3593) + // Minimum execution time: 40_699_000 picoseconds. + Weight::from_parts(41_400_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -129,10 +131,10 @@ impl pallet_currencies::WeightInfo for HydraWeight { /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) fn update_balance_native_currency_killing() -> Weight { // Proof Size summary in bytes: - // Measured: `1590` + // Measured: `1586` // Estimated: `3593` - // Minimum execution time: 40_366_000 picoseconds. - Weight::from_parts(41_238_000, 3593) + // Minimum execution time: 42_556_000 picoseconds. + Weight::from_parts(43_120_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } From 0f1dd4e29a70a1ab02a0e13b925408ca9c5780a4 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 09:52:28 +0200 Subject: [PATCH 24/57] formatting --- runtime/hydradx/src/benchmarking/currencies.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index 215437f13..4e4034ad0 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -1,8 +1,8 @@ -use std::fs; +use crate::{AccountId, Amount, AssetId, Balance, Currencies, EVMAccounts, NativeAssetId, Runtime}; use evm::ExitReason; use fp_rpc::runtime_decl_for_ethereum_runtime_rpc_api::EthereumRuntimeRPCApi; -use crate::{AccountId, Amount, AssetId, Balance, Currencies, EVMAccounts, NativeAssetId, Runtime}; use primitives::constants::currency::NATIVE_EXISTENTIAL_DEPOSIT; +use std::fs; use sp_std::prelude::*; @@ -15,6 +15,9 @@ use frame_benchmarking::BenchmarkError; use frame_support::assert_ok; use hex_literal::hex; +use crate::evm::precompiles::erc20_mapping::{Erc20Mapping, HydraErc20Mapping}; +use crate::evm::Erc20Currency; +use hydradx_traits::evm::{CallContext, EvmAddress, InspectEvmAccounts, ERC20}; use orml_benchmarking::runtime_benchmarks; use orml_traits::MultiCurrency; use orml_traits::MultiCurrencyExtended; @@ -22,9 +25,6 @@ use polkadot_xcm::v3::Junction::AccountKey20; use polkadot_xcm::v3::Junctions::X1; use polkadot_xcm::v3::MultiLocation; use primitive_types::{H160, U256}; -use hydradx_traits::evm::{CallContext, ERC20, EvmAddress, InspectEvmAccounts}; -use crate::evm::Erc20Currency; -use crate::evm::precompiles::erc20_mapping::{Erc20Mapping, HydraErc20Mapping}; use super::*; @@ -160,10 +160,7 @@ pub fn get_contract_bytecode(name: &str) -> Vec { } pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { - assert_ok!(EVMAccounts::add_contract_deployer( - RawOrigin::Root.into(), - deployer, - )); + assert_ok!(EVMAccounts::add_contract_deployer(RawOrigin::Root.into(), deployer,)); let info = crate::Runtime::create( deployer, @@ -221,4 +218,3 @@ fn bind_erc20(contract: EvmAddress) -> AssetId { }); asset.unwrap() } - From 44eca3e6fe611181e639bd262f91c454d0707b9b Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 13:15:42 +0200 Subject: [PATCH 25/57] fix currencies benhcmark - hardcoding sol contract as there is to std fs in the package --- runtime/hydradx/src/benchmarking/currencies.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index 4e4034ad0..9951efa6d 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -2,7 +2,6 @@ use crate::{AccountId, Amount, AssetId, Balance, Currencies, EVMAccounts, Native use evm::ExitReason; use fp_rpc::runtime_decl_for_ethereum_runtime_rpc_api::EthereumRuntimeRPCApi; use primitives::constants::currency::NATIVE_EXISTENTIAL_DEPOSIT; -use std::fs; use sp_std::prelude::*; @@ -149,11 +148,8 @@ mod tests { } pub fn get_contract_bytecode(name: &str) -> Vec { - let path = format!( - "../../scripts/test-contracts/artifacts/contracts/{}.sol/{}.json", - name, name - ); - let str = fs::read_to_string(path).unwrap(); + //We hardcode the contract json as we can't use std::fs to read from file in hydradx-runtime + let str = "{\n \"_format\": \"hh-sol-artifact-1\",\n \"contractName\": \"HydraToken\",\n \"sourceName\": \"contracts/HydraToken.sol\",\n \"abi\": [\n {\n \"inputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"constructor\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"allowance\",\n \"type\": \"uint256\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"needed\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ERC20InsufficientAllowance\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"sender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"balance\",\n \"type\": \"uint256\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"needed\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ERC20InsufficientBalance\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"approver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidApprover\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"receiver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidReceiver\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"sender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidSender\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidSpender\",\n \"type\": \"error\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Approval\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"from\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Transfer\",\n \"type\": \"event\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"approve\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"account\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"decimals\",\n \"outputs\": [\n {\n \"internalType\": \"uint8\",\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"name\",\n \"outputs\": [\n {\n \"internalType\": \"string\",\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"symbol\",\n \"outputs\": [\n {\n \"internalType\": \"string\",\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"totalSupply\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transfer\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"from\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transferFrom\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n }\n ],\n \"bytecode\": \"0x60806040523480156200001157600080fd5b506040518060400160405280600581526020017f48796472610000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f485944524100000000000000000000000000000000000000000000000000000081525081600390816200008f91906200062a565b508060049081620000a191906200062a565b505050620000e433620000b9620000ea60201b60201c565b600a620000c79190620008a1565b633b9aca00620000d89190620008f2565b620000f360201b60201c565b62000a45565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001685760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016200015f919062000982565b60405180910390fd5b6200017c600083836200018060201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620001d6578060026000828254620001c991906200099f565b92505081905550620002ac565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000265578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200025c93929190620009eb565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002f7578060026000828254039250508190555062000344565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000a28565b60405180910390a3505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200043257607f821691505b602082108103620004485762000447620003ea565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004b27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000473565b620004be868362000473565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200050b62000505620004ff84620004d6565b620004e0565b620004d6565b9050919050565b6000819050919050565b6200052783620004ea565b6200053f620005368262000512565b84845462000480565b825550505050565b600090565b6200055662000547565b620005638184846200051c565b505050565b5b818110156200058b576200057f6000826200054c565b60018101905062000569565b5050565b601f821115620005da57620005a4816200044e565b620005af8462000463565b81016020851015620005bf578190505b620005d7620005ce8562000463565b83018262000568565b50505b505050565b600082821c905092915050565b6000620005ff60001984600802620005df565b1980831691505092915050565b60006200061a8383620005ec565b9150826002028217905092915050565b6200063582620003b0565b67ffffffffffffffff811115620006515762000650620003bb565b5b6200065d825462000419565b6200066a8282856200058f565b600060209050601f831160018114620006a257600084156200068d578287015190505b6200069985826200060c565b86555062000709565b601f198416620006b2866200044e565b60005b82811015620006dc57848901518255600182019150602085019450602081019050620006b5565b86831015620006fc5784890151620006f8601f891682620005ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b60018511156200079f5780860481111562000777576200077662000711565b5b6001851615620007875780820291505b8081029050620007978562000740565b945062000757565b94509492505050565b600082620007ba57600190506200088d565b81620007ca57600090506200088d565b8160018114620007e35760028114620007ee5762000824565b60019150506200088d565b60ff84111562000803576200080262000711565b5b8360020a9150848211156200081d576200081c62000711565b5b506200088d565b5060208310610133831016604e8410600b84101617156200085e5782820a90508381111562000858576200085762000711565b5b6200088d565b6200086d84848460016200074d565b9250905081840481111562000887576200088662000711565b5b81810290505b9392505050565b600060ff82169050919050565b6000620008ae82620004d6565b9150620008bb8362000894565b9250620008ea7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007a8565b905092915050565b6000620008ff82620004d6565b91506200090c83620004d6565b92508282026200091c81620004d6565b9150828204841483151762000936576200093562000711565b5b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200096a826200093d565b9050919050565b6200097c816200095d565b82525050565b600060208201905062000999600083018462000971565b92915050565b6000620009ac82620004d6565b9150620009b983620004d6565b9250828201905080821115620009d457620009d362000711565b5b92915050565b620009e581620004d6565b82525050565b600060608201905062000a02600083018662000971565b62000a116020830185620009da565b62000a206040830184620009da565b949350505050565b600060208201905062000a3f6000830184620009da565b92915050565b610e558062000a556000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033\",\n \"deployedBytecode\": \"0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033\",\n \"linkReferences\": {},\n \"deployedLinkReferences\": {}\n}\n"; let json: serde_json::Value = serde_json::from_str(&str).unwrap(); let code = json.get("bytecode").unwrap().as_str().unwrap(); hex::decode(&code[2..]).unwrap() From 14b6beed035fd3b8ebdea6af4c1c2bfe29c2cc14 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 13:54:06 +0200 Subject: [PATCH 26/57] rebenchmark currencies and evm accounts --- .../hydradx/src/weights/pallet_currencies.rs | 60 ++++++++++--------- .../src/weights/pallet_evm_accounts.rs | 38 ++++++------ 2 files changed, 51 insertions(+), 47 deletions(-) diff --git a/runtime/hydradx/src/weights/pallet_currencies.rs b/runtime/hydradx/src/weights/pallet_currencies.rs index dd69f825d..66b220d53 100644 --- a/runtime/hydradx/src/weights/pallet_currencies.rs +++ b/runtime/hydradx/src/weights/pallet_currencies.rs @@ -41,7 +41,7 @@ // 20 // --template=scripts/pallet-weight-template.hbs // --output -// currencies.rs +// curr.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -57,30 +57,32 @@ pub struct WeightInfo(PhantomData); /// Weights for `pallet_currencies` using the HydraDX node and recommended hardware. pub struct HydraWeight(PhantomData); impl pallet_currencies::WeightInfo for HydraWeight { - /// Storage: `Router::SkipEd` (r:1 w:0) - /// Proof: `Router::SkipEd` (`max_values`: Some(1), `max_size`: Some(1), added: 496, mode: `MaxEncodedLen`) - /// Storage: `Duster::AccountBlacklist` (r:1 w:0) - /// Proof: `Duster::AccountBlacklist` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) - /// Storage: `AssetRegistry::BannedAssets` (r:1 w:0) - /// Proof: `AssetRegistry::BannedAssets` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`) - /// Storage: `Tokens::Accounts` (r:2 w:2) - /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) /// Storage: `AssetRegistry::Assets` (r:1 w:0) /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::AssetLocations` (r:1 w:0) + /// Proof: `AssetRegistry::AssetLocations` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) + /// Storage: `EVMAccounts::AccountExtension` (r:2 w:0) + /// Proof: `EVMAccounts::AccountExtension` (`max_values`: None, `max_size`: Some(48), added: 2523, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) - /// Storage: `MultiTransactionPayment::AccountCurrencyMap` (r:1 w:1) - /// Proof: `MultiTransactionPayment::AccountCurrencyMap` (`max_values`: None, `max_size`: Some(52), added: 2527, mode: `MaxEncodedLen`) - /// Storage: `MultiTransactionPayment::AcceptedCurrencies` (r:1 w:0) - /// Proof: `MultiTransactionPayment::AcceptedCurrencies` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) + /// Storage: `System::Digest` (r:1 w:0) + /// Proof: `System::Digest` (`max_values`: Some(1), `max_size`: None, mode: `Measured`) + /// Storage: `EVM::AccountCodes` (r:1 w:0) + /// Proof: `EVM::AccountCodes` (`max_values`: None, `max_size`: None, mode: `Measured`) + /// Storage: `AssetRegistry::NextAssetId` (r:1 w:0) + /// Proof: `AssetRegistry::NextAssetId` (`max_values`: Some(1), `max_size`: Some(4), added: 499, mode: `MaxEncodedLen`) + /// Storage: `AssetRegistry::LocationAssets` (r:1 w:0) + /// Proof: `AssetRegistry::LocationAssets` (`max_values`: None, `max_size`: Some(622), added: 3097, mode: `MaxEncodedLen`) + /// Storage: `EVM::AccountStorages` (r:2 w:2) + /// Proof: `EVM::AccountStorages` (`max_values`: None, `max_size`: None, mode: `Measured`) fn transfer_non_native_currency() -> Weight { // Proof Size summary in bytes: - // Measured: `2853` - // Estimated: `6156` - // Minimum execution time: 100_420_000 picoseconds. - Weight::from_parts(101_470_000, 6156) - .saturating_add(T::DbWeight::get().reads(9_u64)) - .saturating_add(T::DbWeight::get().writes(4_u64)) + // Measured: `6356` + // Estimated: `12296` + // Minimum execution time: 139_742_000 picoseconds. + Weight::from_parts(140_709_000, 12296) + .saturating_add(T::DbWeight::get().reads(11_u64)) + .saturating_add(T::DbWeight::get().writes(3_u64)) } /// Storage: `System::Account` (r:1 w:1) /// Proof: `System::Account` (`max_values`: None, `max_size`: Some(128), added: 2603, mode: `MaxEncodedLen`) @@ -88,17 +90,17 @@ impl pallet_currencies::WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `1638` // Estimated: `3593` - // Minimum execution time: 74_720_000 picoseconds. - Weight::from_parts(75_319_000, 3593) + // Minimum execution time: 72_172_000 picoseconds. + Weight::from_parts(72_566_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } + /// Storage: `AssetRegistry::Assets` (r:1 w:0) + /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `AssetRegistry::BannedAssets` (r:1 w:0) /// Proof: `AssetRegistry::BannedAssets` (`max_values`: None, `max_size`: Some(20), added: 2495, mode: `MaxEncodedLen`) /// Storage: `Tokens::Accounts` (r:1 w:1) /// Proof: `Tokens::Accounts` (`max_values`: None, `max_size`: Some(108), added: 2583, mode: `MaxEncodedLen`) - /// Storage: `AssetRegistry::Assets` (r:1 w:0) - /// Proof: `AssetRegistry::Assets` (`max_values`: None, `max_size`: Some(125), added: 2600, mode: `MaxEncodedLen`) /// Storage: `Tokens::TotalIssuance` (r:1 w:1) /// Proof: `Tokens::TotalIssuance` (`max_values`: None, `max_size`: Some(28), added: 2503, mode: `MaxEncodedLen`) /// Storage: `System::Account` (r:1 w:1) @@ -111,8 +113,8 @@ impl pallet_currencies::WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `2209` // Estimated: `3593` - // Minimum execution time: 65_957_000 picoseconds. - Weight::from_parts(66_856_000, 3593) + // Minimum execution time: 64_369_000 picoseconds. + Weight::from_parts(64_924_000, 3593) .saturating_add(T::DbWeight::get().reads(7_u64)) .saturating_add(T::DbWeight::get().writes(3_u64)) } @@ -122,8 +124,8 @@ impl pallet_currencies::WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `1498` // Estimated: `3593` - // Minimum execution time: 40_699_000 picoseconds. - Weight::from_parts(41_400_000, 3593) + // Minimum execution time: 38_812_000 picoseconds. + Weight::from_parts(39_466_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -133,8 +135,8 @@ impl pallet_currencies::WeightInfo for HydraWeight { // Proof Size summary in bytes: // Measured: `1586` // Estimated: `3593` - // Minimum execution time: 42_556_000 picoseconds. - Weight::from_parts(43_120_000, 3593) + // Minimum execution time: 40_882_000 picoseconds. + Weight::from_parts(41_548_000, 3593) .saturating_add(T::DbWeight::get().reads(1_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } diff --git a/runtime/hydradx/src/weights/pallet_evm_accounts.rs b/runtime/hydradx/src/weights/pallet_evm_accounts.rs index d5c1d1881..85acdd3c1 100644 --- a/runtime/hydradx/src/weights/pallet_evm_accounts.rs +++ b/runtime/hydradx/src/weights/pallet_evm_accounts.rs @@ -19,7 +19,7 @@ //! Autogenerated weights for `pallet_evm_accounts` //! //! THIS FILE WAS AUTO-GENERATED USING THE SUBSTRATE BENCHMARK CLI VERSION 32.0.0 -//! DATE: 2024-05-23, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` +//! DATE: 2024-09-10, STEPS: `50`, REPEAT: `20`, LOW RANGE: `[]`, HIGH RANGE: `[]` //! WORST CASE MAP SIZE: `1000000` //! HOSTNAME: `bench-bot`, CPU: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` //! WASM-EXECUTION: `Compiled`, CHAIN: `None`, DB CACHE: `1024` @@ -30,7 +30,7 @@ // pallet // --wasm-execution=compiled // --pallet -// * +// pallet-evm-accounts // --extrinsic // * // --heap-pages @@ -41,7 +41,7 @@ // 20 // --template=scripts/pallet-weight-template.hbs // --output -// weights/ +// evm-acc.rs #![cfg_attr(rustfmt, rustfmt_skip)] #![allow(unused_parens)] @@ -73,8 +73,8 @@ impl pallet_evm_accounts::WeightInfo for HydraWeight // Proof Size summary in bytes: // Measured: `545` // Estimated: `4087` - // Minimum execution time: 32_109_000 picoseconds. - Weight::from_parts(32_705_000, 4087) + // Minimum execution time: 33_704_000 picoseconds. + Weight::from_parts(34_317_000, 4087) .saturating_add(T::DbWeight::get().reads(6_u64)) .saturating_add(T::DbWeight::get().writes(1_u64)) } @@ -84,8 +84,8 @@ impl pallet_evm_accounts::WeightInfo for HydraWeight // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_574_000 picoseconds. - Weight::from_parts(9_760_000, 0) + // Minimum execution time: 9_908_000 picoseconds. + Weight::from_parts(10_212_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) @@ -94,8 +94,8 @@ impl pallet_evm_accounts::WeightInfo for HydraWeight // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_344_000 picoseconds. - Weight::from_parts(9_633_000, 0) + // Minimum execution time: 9_671_000 picoseconds. + Weight::from_parts(9_858_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } /// Storage: `EVMAccounts::ContractDeployer` (r:0 w:1) @@ -104,26 +104,28 @@ impl pallet_evm_accounts::WeightInfo for HydraWeight // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_421_000 picoseconds. - Weight::from_parts(9_685_000, 0) + // Minimum execution time: 9_872_000 picoseconds. + Weight::from_parts(10_050_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - + /// Storage: `EVMAccounts::ApprovedContract` (r:0 w:1) + /// Proof: `EVMAccounts::ApprovedContract` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) fn approve_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_421_000 picoseconds. - Weight::from_parts(9_685_000, 0) + // Minimum execution time: 9_915_000 picoseconds. + Weight::from_parts(10_164_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } - + /// Storage: `EVMAccounts::ApprovedContract` (r:0 w:1) + /// Proof: `EVMAccounts::ApprovedContract` (`max_values`: None, `max_size`: Some(36), added: 2511, mode: `MaxEncodedLen`) fn disapprove_contract() -> Weight { // Proof Size summary in bytes: // Measured: `0` // Estimated: `0` - // Minimum execution time: 9_421_000 picoseconds. - Weight::from_parts(9_685_000, 0) + // Minimum execution time: 9_563_000 picoseconds. + Weight::from_parts(9_834_000, 0) .saturating_add(T::DbWeight::get().writes(1_u64)) } -} +} \ No newline at end of file From b6c39b1c2c2fa3841c031f4f66e0ba0bcebd0b7a Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 15:13:51 +0200 Subject: [PATCH 27/57] make clippy happy --- runtime/hydradx/src/benchmarking/currencies.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index 9951efa6d..dace1c935 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -12,9 +12,7 @@ use sp_runtime::SaturatedConversion; use frame_benchmarking::BenchmarkError; use frame_support::assert_ok; -use hex_literal::hex; -use crate::evm::precompiles::erc20_mapping::{Erc20Mapping, HydraErc20Mapping}; use crate::evm::Erc20Currency; use hydradx_traits::evm::{CallContext, EvmAddress, InspectEvmAccounts, ERC20}; use orml_benchmarking::runtime_benchmarks; @@ -23,7 +21,7 @@ use orml_traits::MultiCurrencyExtended; use polkadot_xcm::v3::Junction::AccountKey20; use polkadot_xcm::v3::Junctions::X1; use polkadot_xcm::v3::MultiLocation; -use primitive_types::{H160, U256}; +use primitive_types::{U256}; use super::*; @@ -147,10 +145,10 @@ mod tests { impl_benchmark_test_suite!(new_test_ext(),); } -pub fn get_contract_bytecode(name: &str) -> Vec { +pub fn get_contract_bytecode() -> Vec { //We hardcode the contract json as we can't use std::fs to read from file in hydradx-runtime let str = "{\n \"_format\": \"hh-sol-artifact-1\",\n \"contractName\": \"HydraToken\",\n \"sourceName\": \"contracts/HydraToken.sol\",\n \"abi\": [\n {\n \"inputs\": [],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"constructor\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"allowance\",\n \"type\": \"uint256\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"needed\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ERC20InsufficientAllowance\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"sender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"balance\",\n \"type\": \"uint256\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"needed\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"ERC20InsufficientBalance\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"approver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidApprover\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"receiver\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidReceiver\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"sender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidSender\",\n \"type\": \"error\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"ERC20InvalidSpender\",\n \"type\": \"error\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Approval\",\n \"type\": \"event\"\n },\n {\n \"anonymous\": false,\n \"inputs\": [\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"from\",\n \"type\": \"address\"\n },\n {\n \"indexed\": true,\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"indexed\": false,\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"Transfer\",\n \"type\": \"event\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"owner\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"allowance\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"spender\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"approve\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"account\",\n \"type\": \"address\"\n }\n ],\n \"name\": \"balanceOf\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"decimals\",\n \"outputs\": [\n {\n \"internalType\": \"uint8\",\n \"name\": \"\",\n \"type\": \"uint8\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"name\",\n \"outputs\": [\n {\n \"internalType\": \"string\",\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"symbol\",\n \"outputs\": [\n {\n \"internalType\": \"string\",\n \"name\": \"\",\n \"type\": \"string\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [],\n \"name\": \"totalSupply\",\n \"outputs\": [\n {\n \"internalType\": \"uint256\",\n \"name\": \"\",\n \"type\": \"uint256\"\n }\n ],\n \"stateMutability\": \"view\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transfer\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n },\n {\n \"inputs\": [\n {\n \"internalType\": \"address\",\n \"name\": \"from\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"address\",\n \"name\": \"to\",\n \"type\": \"address\"\n },\n {\n \"internalType\": \"uint256\",\n \"name\": \"value\",\n \"type\": \"uint256\"\n }\n ],\n \"name\": \"transferFrom\",\n \"outputs\": [\n {\n \"internalType\": \"bool\",\n \"name\": \"\",\n \"type\": \"bool\"\n }\n ],\n \"stateMutability\": \"nonpayable\",\n \"type\": \"function\"\n }\n ],\n \"bytecode\": \"0x60806040523480156200001157600080fd5b506040518060400160405280600581526020017f48796472610000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f485944524100000000000000000000000000000000000000000000000000000081525081600390816200008f91906200062a565b508060049081620000a191906200062a565b505050620000e433620000b9620000ea60201b60201c565b600a620000c79190620008a1565b633b9aca00620000d89190620008f2565b620000f360201b60201c565b62000a45565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001685760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016200015f919062000982565b60405180910390fd5b6200017c600083836200018060201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620001d6578060026000828254620001c991906200099f565b92505081905550620002ac565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000265578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200025c93929190620009eb565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002f7578060026000828254039250508190555062000344565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000a28565b60405180910390a3505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200043257607f821691505b602082108103620004485762000447620003ea565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004b27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000473565b620004be868362000473565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200050b62000505620004ff84620004d6565b620004e0565b620004d6565b9050919050565b6000819050919050565b6200052783620004ea565b6200053f620005368262000512565b84845462000480565b825550505050565b600090565b6200055662000547565b620005638184846200051c565b505050565b5b818110156200058b576200057f6000826200054c565b60018101905062000569565b5050565b601f821115620005da57620005a4816200044e565b620005af8462000463565b81016020851015620005bf578190505b620005d7620005ce8562000463565b83018262000568565b50505b505050565b600082821c905092915050565b6000620005ff60001984600802620005df565b1980831691505092915050565b60006200061a8383620005ec565b9150826002028217905092915050565b6200063582620003b0565b67ffffffffffffffff811115620006515762000650620003bb565b5b6200065d825462000419565b6200066a8282856200058f565b600060209050601f831160018114620006a257600084156200068d578287015190505b6200069985826200060c565b86555062000709565b601f198416620006b2866200044e565b60005b82811015620006dc57848901518255600182019150602085019450602081019050620006b5565b86831015620006fc5784890151620006f8601f891682620005ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b60018511156200079f5780860481111562000777576200077662000711565b5b6001851615620007875780820291505b8081029050620007978562000740565b945062000757565b94509492505050565b600082620007ba57600190506200088d565b81620007ca57600090506200088d565b8160018114620007e35760028114620007ee5762000824565b60019150506200088d565b60ff84111562000803576200080262000711565b5b8360020a9150848211156200081d576200081c62000711565b5b506200088d565b5060208310610133831016604e8410600b84101617156200085e5782820a90508381111562000858576200085762000711565b5b6200088d565b6200086d84848460016200074d565b9250905081840481111562000887576200088662000711565b5b81810290505b9392505050565b600060ff82169050919050565b6000620008ae82620004d6565b9150620008bb8362000894565b9250620008ea7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007a8565b905092915050565b6000620008ff82620004d6565b91506200090c83620004d6565b92508282026200091c81620004d6565b9150828204841483151762000936576200093562000711565b5b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200096a826200093d565b9050919050565b6200097c816200095d565b82525050565b600060208201905062000999600083018462000971565b92915050565b6000620009ac82620004d6565b9150620009b983620004d6565b9250828201905080821115620009d457620009d362000711565b5b92915050565b620009e581620004d6565b82525050565b600060608201905062000a02600083018662000971565b62000a116020830185620009da565b62000a206040830184620009da565b949350505050565b600060208201905062000a3f6000830184620009da565b92915050565b610e558062000a556000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033\",\n \"deployedBytecode\": \"0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033\",\n \"linkReferences\": {},\n \"deployedLinkReferences\": {}\n}\n"; - let json: serde_json::Value = serde_json::from_str(&str).unwrap(); + let json: serde_json::Value = serde_json::from_str(str).unwrap(); let code = json.get("bytecode").unwrap().as_str().unwrap(); hex::decode(&code[2..]).unwrap() } @@ -175,13 +173,13 @@ pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { reason => panic!("{:?}", reason), }; - let deployed = crate::Runtime::account_code_at(address.clone()); + let deployed = crate::Runtime::account_code_at(address); assert_ne!(deployed, vec![0; deployed.len()]); address } -pub fn deploy_contract(name: &str, deployer: EvmAddress) -> EvmAddress { - deploy_contract_code(get_contract_bytecode(name), deployer) +pub fn deploy_contract(deployer: EvmAddress) -> EvmAddress { + deploy_contract_code(get_contract_bytecode(), deployer) } pub fn deployer(who: AccountId) -> EvmAddress { @@ -189,7 +187,7 @@ pub fn deployer(who: AccountId) -> EvmAddress { } pub fn deploy_token_contract(who: AccountId) -> EvmAddress { - deploy_contract("HydraToken", deployer(who)) + deploy_contract(deployer(who)) } fn bind_erc20(contract: EvmAddress) -> AssetId { @@ -201,7 +199,7 @@ fn bind_erc20(contract: EvmAddress) -> AssetId { AssetKind::Erc20, 1, Some(Erc20Currency::::symbol(token).unwrap().try_into().unwrap()), - Some(Erc20Currency::::decimals(token).unwrap().try_into().unwrap()), + Some(Erc20Currency::::decimals(token).unwrap()), Some(AssetLocation(MultiLocation::new( 0, X1(AccountKey20 { From 4c0426d4e5de39e5f15f69e87fe64912a3105d96 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 10 Sep 2024 15:18:01 +0200 Subject: [PATCH 28/57] formatting --- runtime/hydradx/src/benchmarking/currencies.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hydradx/src/benchmarking/currencies.rs b/runtime/hydradx/src/benchmarking/currencies.rs index dace1c935..5c64b8fb7 100644 --- a/runtime/hydradx/src/benchmarking/currencies.rs +++ b/runtime/hydradx/src/benchmarking/currencies.rs @@ -21,7 +21,7 @@ use orml_traits::MultiCurrencyExtended; use polkadot_xcm::v3::Junction::AccountKey20; use polkadot_xcm::v3::Junctions::X1; use polkadot_xcm::v3::MultiLocation; -use primitive_types::{U256}; +use primitive_types::U256; use super::*; From 71ed837dd511b3decb303baf593af4ae31827477 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 10 Sep 2024 17:43:03 +0200 Subject: [PATCH 29/57] test token deployment on nice --- scripts/test-contracts/.gitignore | 1 + scripts/test-contracts/hardhat.config.js | 24 ++ .../artifacts/HydraToken#HydraToken.json | 324 ++++++++++++++ .../chain-222222/deployed_addresses.json | 3 + .../deployments/chain-222222/journal.jsonl | 7 + .../ignition/modules/HydraToken.js | 9 + scripts/test-contracts/package-lock.json | 399 ++++++++++++++---- scripts/test-contracts/package.json | 6 + 8 files changed, 699 insertions(+), 74 deletions(-) create mode 100644 scripts/test-contracts/ignition/deployments/chain-222222/artifacts/HydraToken#HydraToken.json create mode 100644 scripts/test-contracts/ignition/deployments/chain-222222/deployed_addresses.json create mode 100644 scripts/test-contracts/ignition/deployments/chain-222222/journal.jsonl create mode 100644 scripts/test-contracts/ignition/modules/HydraToken.js diff --git a/scripts/test-contracts/.gitignore b/scripts/test-contracts/.gitignore index 8b80a9b4c..fbfc88c71 100644 --- a/scripts/test-contracts/.gitignore +++ b/scripts/test-contracts/.gitignore @@ -7,6 +7,7 @@ node_modules /cache /artifacts/* !/artifacts/contracts +ignition/deployments/*/build-info # TypeChain files /typechain diff --git a/scripts/test-contracts/hardhat.config.js b/scripts/test-contracts/hardhat.config.js index 8ba99bc91..5e3bfbe2a 100644 --- a/scripts/test-contracts/hardhat.config.js +++ b/scripts/test-contracts/hardhat.config.js @@ -1,6 +1,30 @@ require("@nomicfoundation/hardhat-toolbox"); +require("@nomicfoundation/hardhat-verify"); +const {vars} = require("hardhat/config"); +const PRIVKEY = vars.get("PRIVKEY"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { solidity: "0.8.24", + networks: { + nice: { + url: "https://rpc.nice.hydration.cloud", + accounts: [PRIVKEY] + } + }, + etherscan: { + apiKey: { + nice: "nice" + }, + customChains: [ + { + network: "nice", + chainId: 222222, + urls: { + apiURL: "https://blockscout.nice.hydration.cloud/api", + browserURL: "https://blockscout.nice.hydration.cloud" + } + } + ] + } }; diff --git a/scripts/test-contracts/ignition/deployments/chain-222222/artifacts/HydraToken#HydraToken.json b/scripts/test-contracts/ignition/deployments/chain-222222/artifacts/HydraToken#HydraToken.json new file mode 100644 index 000000000..f99240f35 --- /dev/null +++ b/scripts/test-contracts/ignition/deployments/chain-222222/artifacts/HydraToken#HydraToken.json @@ -0,0 +1,324 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "HydraToken", + "sourceName": "contracts/HydraToken.sol", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "allowance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientAllowance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "needed", + "type": "uint256" + } + ], + "name": "ERC20InsufficientBalance", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "approver", + "type": "address" + } + ], + "name": "ERC20InvalidApprover", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + } + ], + "name": "ERC20InvalidReceiver", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + } + ], + "name": "ERC20InvalidSender", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "ERC20InvalidSpender", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Approval", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "Transfer", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "address", + "name": "spender", + "type": "address" + } + ], + "name": "allowance", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "spender", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "decimals", + "outputs": [ + { + "internalType": "uint8", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "name", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "symbol", + "outputs": [ + { + "internalType": "string", + "name": "", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "totalSupply", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + } + ], + "name": "transferFrom", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "bytecode": "0x60806040523480156200001157600080fd5b506040518060400160405280600581526020017f48796472610000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f485944524100000000000000000000000000000000000000000000000000000081525081600390816200008f91906200062a565b508060049081620000a191906200062a565b505050620000e433620000b9620000ea60201b60201c565b600a620000c79190620008a1565b633b9aca00620000d89190620008f2565b620000f360201b60201c565b62000a45565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001685760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016200015f919062000982565b60405180910390fd5b6200017c600083836200018060201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620001d6578060026000828254620001c991906200099f565b92505081905550620002ac565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000265578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200025c93929190620009eb565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002f7578060026000828254039250508190555062000344565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000a28565b60405180910390a3505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200043257607f821691505b602082108103620004485762000447620003ea565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004b27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000473565b620004be868362000473565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200050b62000505620004ff84620004d6565b620004e0565b620004d6565b9050919050565b6000819050919050565b6200052783620004ea565b6200053f620005368262000512565b84845462000480565b825550505050565b600090565b6200055662000547565b620005638184846200051c565b505050565b5b818110156200058b576200057f6000826200054c565b60018101905062000569565b5050565b601f821115620005da57620005a4816200044e565b620005af8462000463565b81016020851015620005bf578190505b620005d7620005ce8562000463565b83018262000568565b50505b505050565b600082821c905092915050565b6000620005ff60001984600802620005df565b1980831691505092915050565b60006200061a8383620005ec565b9150826002028217905092915050565b6200063582620003b0565b67ffffffffffffffff811115620006515762000650620003bb565b5b6200065d825462000419565b6200066a8282856200058f565b600060209050601f831160018114620006a257600084156200068d578287015190505b6200069985826200060c565b86555062000709565b601f198416620006b2866200044e565b60005b82811015620006dc57848901518255600182019150602085019450602081019050620006b5565b86831015620006fc5784890151620006f8601f891682620005ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b60018511156200079f5780860481111562000777576200077662000711565b5b6001851615620007875780820291505b8081029050620007978562000740565b945062000757565b94509492505050565b600082620007ba57600190506200088d565b81620007ca57600090506200088d565b8160018114620007e35760028114620007ee5762000824565b60019150506200088d565b60ff84111562000803576200080262000711565b5b8360020a9150848211156200081d576200081c62000711565b5b506200088d565b5060208310610133831016604e8410600b84101617156200085e5782820a90508381111562000858576200085762000711565b5b6200088d565b6200086d84848460016200074d565b9250905081840481111562000887576200088662000711565b5b81810290505b9392505050565b600060ff82169050919050565b6000620008ae82620004d6565b9150620008bb8362000894565b9250620008ea7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007a8565b905092915050565b6000620008ff82620004d6565b91506200090c83620004d6565b92508282026200091c81620004d6565b9150828204841483151762000936576200093562000711565b5b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200096a826200093d565b9050919050565b6200097c816200095d565b82525050565b600060208201905062000999600083018462000971565b92915050565b6000620009ac82620004d6565b9150620009b983620004d6565b9250828201905080821115620009d457620009d362000711565b5b92915050565b620009e581620004d6565b82525050565b600060608201905062000a02600083018662000971565b62000a116020830185620009da565b62000a206040830184620009da565b949350505050565b600060208201905062000a3f6000830184620009da565b92915050565b610e558062000a556000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} \ No newline at end of file diff --git a/scripts/test-contracts/ignition/deployments/chain-222222/deployed_addresses.json b/scripts/test-contracts/ignition/deployments/chain-222222/deployed_addresses.json new file mode 100644 index 000000000..b13658e91 --- /dev/null +++ b/scripts/test-contracts/ignition/deployments/chain-222222/deployed_addresses.json @@ -0,0 +1,3 @@ +{ + "HydraToken#HydraToken": "0x475761D2a9c85a5648E69a34Bd35a9F3F419bf8E" +} diff --git a/scripts/test-contracts/ignition/deployments/chain-222222/journal.jsonl b/scripts/test-contracts/ignition/deployments/chain-222222/journal.jsonl new file mode 100644 index 000000000..57ee21017 --- /dev/null +++ b/scripts/test-contracts/ignition/deployments/chain-222222/journal.jsonl @@ -0,0 +1,7 @@ + +{"chainId":222222,"type":"DEPLOYMENT_INITIALIZE"} +{"artifactId":"HydraToken#HydraToken","constructorArgs":[],"contractName":"HydraToken","dependencies":[],"from":"0x26b2b49d90e281743217117a549a5b24d29b296d","futureId":"HydraToken#HydraToken","futureType":"NAMED_ARTIFACT_CONTRACT_DEPLOYMENT","libraries":{},"strategy":"basic","strategyConfig":{},"type":"DEPLOYMENT_EXECUTION_STATE_INITIALIZE","value":{"_kind":"bigint","value":"0"}} +{"futureId":"HydraToken#HydraToken","networkInteraction":{"data":"0x60806040523480156200001157600080fd5b506040518060400160405280600581526020017f48796472610000000000000000000000000000000000000000000000000000008152506040518060400160405280600581526020017f485944524100000000000000000000000000000000000000000000000000000081525081600390816200008f91906200062a565b508060049081620000a191906200062a565b505050620000e433620000b9620000ea60201b60201c565b600a620000c79190620008a1565b633b9aca00620000d89190620008f2565b620000f360201b60201c565b62000a45565b60006012905090565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001685760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016200015f919062000982565b60405180910390fd5b6200017c600083836200018060201b60201c565b5050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603620001d6578060026000828254620001c991906200099f565b92505081905550620002ac565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101562000265578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016200025c93929190620009eb565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620002f7578060026000828254039250508190555062000344565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620003a3919062000a28565b60405180910390a3505050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200043257607f821691505b602082108103620004485762000447620003ea565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620004b27fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000473565b620004be868362000473565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b60006200050b62000505620004ff84620004d6565b620004e0565b620004d6565b9050919050565b6000819050919050565b6200052783620004ea565b6200053f620005368262000512565b84845462000480565b825550505050565b600090565b6200055662000547565b620005638184846200051c565b505050565b5b818110156200058b576200057f6000826200054c565b60018101905062000569565b5050565b601f821115620005da57620005a4816200044e565b620005af8462000463565b81016020851015620005bf578190505b620005d7620005ce8562000463565b83018262000568565b50505b505050565b600082821c905092915050565b6000620005ff60001984600802620005df565b1980831691505092915050565b60006200061a8383620005ec565b9150826002028217905092915050565b6200063582620003b0565b67ffffffffffffffff811115620006515762000650620003bb565b5b6200065d825462000419565b6200066a8282856200058f565b600060209050601f831160018114620006a257600084156200068d578287015190505b6200069985826200060c565b86555062000709565b601f198416620006b2866200044e565b60005b82811015620006dc57848901518255600182019150602085019450602081019050620006b5565b86831015620006fc5784890151620006f8601f891682620005ec565b8355505b6001600288020188555050505b505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60008160011c9050919050565b6000808291508390505b60018511156200079f5780860481111562000777576200077662000711565b5b6001851615620007875780820291505b8081029050620007978562000740565b945062000757565b94509492505050565b600082620007ba57600190506200088d565b81620007ca57600090506200088d565b8160018114620007e35760028114620007ee5762000824565b60019150506200088d565b60ff84111562000803576200080262000711565b5b8360020a9150848211156200081d576200081c62000711565b5b506200088d565b5060208310610133831016604e8410600b84101617156200085e5782820a90508381111562000858576200085762000711565b5b6200088d565b6200086d84848460016200074d565b9250905081840481111562000887576200088662000711565b5b81810290505b9392505050565b600060ff82169050919050565b6000620008ae82620004d6565b9150620008bb8362000894565b9250620008ea7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8484620007a8565b905092915050565b6000620008ff82620004d6565b91506200090c83620004d6565b92508282026200091c81620004d6565b9150828204841483151762000936576200093562000711565b5b5092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006200096a826200093d565b9050919050565b6200097c816200095d565b82525050565b600060208201905062000999600083018462000971565b92915050565b6000620009ac82620004d6565b9150620009b983620004d6565b9250828201905080821115620009d457620009d362000711565b5b92915050565b620009e581620004d6565b82525050565b600060608201905062000a02600083018662000971565b62000a116020830185620009da565b62000a206040830184620009da565b949350505050565b600060208201905062000a3f6000830184620009da565b92915050565b610e558062000a556000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063313ce56711610066578063313ce5671461013457806370a082311461015257806395d89b4114610182578063a9059cbb146101a0578063dd62ed3e146101d057610093565b806306fdde0314610098578063095ea7b3146100b657806318160ddd146100e657806323b872dd14610104575b600080fd5b6100a0610200565b6040516100ad9190610aa9565b60405180910390f35b6100d060048036038101906100cb9190610b64565b610292565b6040516100dd9190610bbf565b60405180910390f35b6100ee6102b5565b6040516100fb9190610be9565b60405180910390f35b61011e60048036038101906101199190610c04565b6102bf565b60405161012b9190610bbf565b60405180910390f35b61013c6102ee565b6040516101499190610c73565b60405180910390f35b61016c60048036038101906101679190610c8e565b6102f7565b6040516101799190610be9565b60405180910390f35b61018a61033f565b6040516101979190610aa9565b60405180910390f35b6101ba60048036038101906101b59190610b64565b6103d1565b6040516101c79190610bbf565b60405180910390f35b6101ea60048036038101906101e59190610cbb565b6103f4565b6040516101f79190610be9565b60405180910390f35b60606003805461020f90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461023b90610d2a565b80156102885780601f1061025d57610100808354040283529160200191610288565b820191906000526020600020905b81548152906001019060200180831161026b57829003601f168201915b5050505050905090565b60008061029d61047b565b90506102aa818585610483565b600191505092915050565b6000600254905090565b6000806102ca61047b565b90506102d7858285610495565b6102e2858585610529565b60019150509392505050565b60006012905090565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461034e90610d2a565b80601f016020809104026020016040519081016040528092919081815260200182805461037a90610d2a565b80156103c75780601f1061039c576101008083540402835291602001916103c7565b820191906000526020600020905b8154815290600101906020018083116103aa57829003601f168201915b5050505050905090565b6000806103dc61047b565b90506103e9818585610529565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b610490838383600161061d565b505050565b60006104a184846103f4565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146105235781811015610513578281836040517ffb8f41b200000000000000000000000000000000000000000000000000000000815260040161050a93929190610d6a565b60405180910390fd5b6105228484848403600061061d565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361059b5760006040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016105929190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361060d5760006040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106049190610da1565b60405180910390fd5b6106188383836107f4565b505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361068f5760006040517fe602df050000000000000000000000000000000000000000000000000000000081526004016106869190610da1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107015760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016106f89190610da1565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156107ee578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516107e59190610be9565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361084657806002600082825461083a9190610deb565b92505081905550610919565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156108d2578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016108c993929190610d6a565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361096257806002600082825403925050819055506109af565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610a0c9190610be9565b60405180910390a3505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610a53578082015181840152602081019050610a38565b60008484015250505050565b6000601f19601f8301169050919050565b6000610a7b82610a19565b610a858185610a24565b9350610a95818560208601610a35565b610a9e81610a5f565b840191505092915050565b60006020820190508181036000830152610ac38184610a70565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610afb82610ad0565b9050919050565b610b0b81610af0565b8114610b1657600080fd5b50565b600081359050610b2881610b02565b92915050565b6000819050919050565b610b4181610b2e565b8114610b4c57600080fd5b50565b600081359050610b5e81610b38565b92915050565b60008060408385031215610b7b57610b7a610acb565b5b6000610b8985828601610b19565b9250506020610b9a85828601610b4f565b9150509250929050565b60008115159050919050565b610bb981610ba4565b82525050565b6000602082019050610bd46000830184610bb0565b92915050565b610be381610b2e565b82525050565b6000602082019050610bfe6000830184610bda565b92915050565b600080600060608486031215610c1d57610c1c610acb565b5b6000610c2b86828701610b19565b9350506020610c3c86828701610b19565b9250506040610c4d86828701610b4f565b9150509250925092565b600060ff82169050919050565b610c6d81610c57565b82525050565b6000602082019050610c886000830184610c64565b92915050565b600060208284031215610ca457610ca3610acb565b5b6000610cb284828501610b19565b91505092915050565b60008060408385031215610cd257610cd1610acb565b5b6000610ce085828601610b19565b9250506020610cf185828601610b19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610d4257607f821691505b602082108103610d5557610d54610cfb565b5b50919050565b610d6481610af0565b82525050565b6000606082019050610d7f6000830186610d5b565b610d8c6020830185610bda565b610d996040830184610bda565b949350505050565b6000602082019050610db66000830184610d5b565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df682610b2e565b9150610e0183610b2e565b9250828201905080821115610e1957610e18610dbc565b5b9291505056fea2646970667358221220eba77a3f075cfc5f27e5c89b9bbe62844e377f70b8c7a20a4535007252c2d48664736f6c63430008180033","id":1,"type":"ONCHAIN_INTERACTION","value":{"_kind":"bigint","value":"0"}},"type":"NETWORK_INTERACTION_REQUEST"} +{"futureId":"HydraToken#HydraToken","networkInteractionId":1,"nonce":0,"transaction":{"fees":{"maxFeePerGas":{"_kind":"bigint","value":"181303140"},"maxPriorityFeePerGas":{"_kind":"bigint","value":"0"}},"hash":"0x319f66847d751836ab4c22ac081e608c98e3e9907147ceadc416744a8138874d"},"type":"TRANSACTION_SEND"} +{"futureId":"HydraToken#HydraToken","hash":"0x319f66847d751836ab4c22ac081e608c98e3e9907147ceadc416744a8138874d","networkInteractionId":1,"receipt":{"blockHash":"0x90cf82ea9d63285acf111919826195458aa331969ca5e955f0d141f5a1c6a103","blockNumber":2037552,"contractAddress":"0x475761D2a9c85a5648E69a34Bd35a9F3F419bf8E","logs":[{"address":"0x475761D2a9c85a5648E69a34Bd35a9F3F419bf8E","data":"0x0000000000000000000000000000000000000000033b2e3c9fd0803ce8000000","logIndex":0,"topics":["0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef","0x0000000000000000000000000000000000000000000000000000000000000000","0x00000000000000000000000026b2b49d90e281743217117a549a5b24d29b296d"]}],"status":"SUCCESS"},"type":"TRANSACTION_CONFIRM"} +{"futureId":"HydraToken#HydraToken","result":{"address":"0x475761D2a9c85a5648E69a34Bd35a9F3F419bf8E","type":"SUCCESS"},"type":"DEPLOYMENT_EXECUTION_STATE_COMPLETE"} \ No newline at end of file diff --git a/scripts/test-contracts/ignition/modules/HydraToken.js b/scripts/test-contracts/ignition/modules/HydraToken.js new file mode 100644 index 000000000..9c99ee7b0 --- /dev/null +++ b/scripts/test-contracts/ignition/modules/HydraToken.js @@ -0,0 +1,9 @@ +const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); + +const HydraToken = buildModule("HydraToken", (m) => { + const token = m.contract("HydraToken"); + + return { token }; +}); + +module.exports = HydraToken; diff --git a/scripts/test-contracts/package-lock.json b/scripts/test-contracts/package-lock.json index a98c3390f..8cecba6c7 100644 --- a/scripts/test-contracts/package-lock.json +++ b/scripts/test-contracts/package-lock.json @@ -12,7 +12,13 @@ "@openzeppelin/contracts": "^5.0.2" }, "devDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.8", + "@nomicfoundation/hardhat-ignition": "^0.15.5", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.5", "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.10", + "@nomicfoundation/ignition-core": "^0.15.5", + "ether": "^0.0.9", "hardhat": "^2.22.10" } }, @@ -21,8 +27,7 @@ "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -979,7 +984,6 @@ "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "@noble/hashes": "1.3.2" }, @@ -993,7 +997,6 @@ "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 16" }, @@ -1299,8 +1302,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ethers/-/hardhat-ethers-3.0.8.tgz", "integrity": "sha512-zhOZ4hdRORls31DTOqg+GmEZM0ujly8GGIuRY7t7szEk2zW/arY1qDug/py8AEktT00v5K+b6RvbVog+va51IA==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { "debug": "^4.1.1", "lodash.isequal": "^4.5.0" @@ -1315,8 +1316,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition/-/hardhat-ignition-0.15.5.tgz", "integrity": "sha512-Y5nhFXFqt4owA6Ooag8ZBFDF2RAZElMXViknVIsi3m45pbQimS50ti6FU8HxfRkDnBARa40CIn7UGV0hrelzDw==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { "@nomicfoundation/ignition-core": "^0.15.5", "@nomicfoundation/ignition-ui": "^0.15.5", @@ -1335,8 +1334,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-ignition-ethers/-/hardhat-ignition-ethers-0.15.5.tgz", "integrity": "sha512-W6s1QN9CFxzSVZS6w9Jcj3WLaK32z2FP5MxNU2OKY1Fn9ZzLr+miXbUbWYuRHl6dxrrl6sE8cv33Cybv19pmCg==", "dev": true, - "license": "MIT", - "peer": true, "peerDependencies": { "@nomicfoundation/hardhat-ethers": "^3.0.4", "@nomicfoundation/hardhat-ignition": "^0.15.5", @@ -1351,7 +1348,6 @@ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -1368,7 +1364,6 @@ "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -1386,7 +1381,6 @@ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -1399,8 +1393,7 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/@nomicfoundation/hardhat-ignition/node_modules/fs-extra": { "version": "10.1.0", @@ -1408,7 +1401,6 @@ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1424,7 +1416,6 @@ "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -1435,7 +1426,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "universalify": "^2.0.0" }, @@ -1449,7 +1439,6 @@ "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -1463,7 +1452,6 @@ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 10.0.0" } @@ -1557,8 +1545,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/hardhat-verify/-/hardhat-verify-2.0.10.tgz", "integrity": "sha512-3zoTZGQhpeOm6piJDdsGb6euzZAd7N5Tk0zPQvGnfKQ0+AoxKz/7i4if12goi8IDTuUGElAUuZyQB8PMQoXA5g==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { "@ethersproject/abi": "^5.1.2", "@ethersproject/address": "^5.0.2", @@ -1579,8 +1565,6 @@ "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-core/-/ignition-core-0.15.5.tgz", "integrity": "sha512-FgvuoIXhakRSP524JzNQ4BviyzBBKpsFaOWubPZ4XACLT4/7vGqlJ/7DIn0D2NL2anQ2qs98/BNBY9WccXUX1Q==", "dev": true, - "license": "MIT", - "peer": true, "dependencies": { "@ethersproject/address": "5.6.1", "@nomicfoundation/solidity-analyzer": "^0.1.1", @@ -1609,7 +1593,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "@ethersproject/bignumber": "^5.6.2", "@ethersproject/bytes": "^5.6.1", @@ -1624,7 +1607,6 @@ "integrity": "sha512-JPypkxsB10s9QOWwa6zwPzqE1Md3vqpPc+cai4sAecuCsRyAtAl/pMyhPlMbT/xtPnm2dznJZYRLui57qiRhaQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "nofilter": "^3.1.0" }, @@ -1638,7 +1620,6 @@ "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -1654,7 +1635,6 @@ "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "universalify": "^2.0.0" }, @@ -1668,7 +1648,6 @@ "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 10.0.0" } @@ -1677,8 +1656,7 @@ "version": "0.15.5", "resolved": "https://registry.npmjs.org/@nomicfoundation/ignition-ui/-/ignition-ui-0.15.5.tgz", "integrity": "sha512-ZcE4rIn10qKahR4OqS8rl8NM2Fbg2QYiBXgMgj74ZI0++LlCcZgB5HyaBbX+lsnKHjTXtjYD3b+2mtg7jFbAMQ==", - "dev": true, - "peer": true + "dev": true }, "node_modules/@nomicfoundation/solidity-analyzer": { "version": "0.1.2", @@ -2238,8 +2216,7 @@ "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/agent-base": { "version": "6.0.2", @@ -2274,7 +2251,6 @@ "integrity": "sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "fast-deep-equal": "^3.1.3", "fast-uri": "^3.0.1", @@ -2452,7 +2428,6 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=8" } @@ -2808,7 +2783,6 @@ "integrity": "sha512-DwGjNW9omn6EwP70aXsn7FQJx5kO12tX0bZkaTjzdVFM6/7nhA4t0EENocKGx6D2Bch9PE2KzCUf5SceBdeijg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "nofilter": "^3.1.0" }, @@ -2956,6 +2930,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/cli-color": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/cli-color/-/cli-color-0.2.3.tgz", + "integrity": "sha512-f4DFHXdoe2rGMwuVO+DTBM6CkSt4m9R4a0vjnq5CJkSCKaXbrHbslCmyjG6cz/o50HP2wkjO3G1mXvc7G3V1LQ==", + "dev": true, + "dependencies": { + "es5-ext": "~0.9.2", + "memoizee": "~0.2.5" + }, + "engines": { + "node": ">=0.1.103" + } + }, "node_modules/cli-table3": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.5.1.tgz", @@ -3222,6 +3209,15 @@ "node": ">= 0.6" } }, + "node_modules/cookiejar": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-1.3.0.tgz", + "integrity": "sha512-U+NgxxtwHIokuL04FqKEkqsaWBDtnCQo+wvYjUCtBA56Lcg8vpV3SGtBx+RAmw92SV3VT8PwsYcCFK/cC3Dw+A==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/core-util-is": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", @@ -3449,6 +3445,12 @@ "dev": true, "license": "MIT" }, + "node_modules/emitter-component": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/emitter-component/-/emitter-component-1.0.0.tgz", + "integrity": "sha512-GZrLdp4Z7OERecoYQYElVVqf6/gcbGUs8nvaE+nmu2dGy453lLgGyPLNX9DdSyojdMqI86fCT9XQqsWJymciEw==", + "dev": true + }, "node_modules/emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -3505,6 +3507,15 @@ "node": ">= 0.4" } }, + "node_modules/es5-ext": { + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.9.2.tgz", + "integrity": "sha512-wP3OSxZ0L/qK76t6qxPR8gWr2o5F4SzNF9qS5F/mOfVY3Ezcg07v6hSkETDmoekXIzn8xhQbHpp+tVlOE+qOAg==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/escalade": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", @@ -3680,6 +3691,32 @@ "@ethersproject/wordlists": "5.7.0" } }, + "node_modules/ether": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/ether/-/ether-0.0.9.tgz", + "integrity": "sha512-KYive1RzWSVsOTnGM0GHCUkeAz/TtNA9XRzd+WS0GndvXlmpKyNQ9n69SF46lJmNeuMtvgcG+LIDXZYhk2/kDQ==", + "dev": true, + "dependencies": { + "commander": "~2.1.0", + "inquirer": "~0.4.0", + "memoizee": "~0.2.6", + "micro-engine": "0.0.1", + "sudo-block": "~0.3.0", + "superagent": "~0.16.0" + }, + "bin": { + "ether": "bin/index.js" + } + }, + "node_modules/ether/node_modules/commander": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.1.0.tgz", + "integrity": "sha512-J2wnb6TKniXNOtoHS8TSrG9IOQluPrsmyAJ8oCUJOBmv+uLBCyPYAZkD2jFvw2DCzIXNnISIM01NIvr35TkBMQ==", + "dev": true, + "engines": { + "node": ">= 0.6.x" + } + }, "node_modules/ethereum-bloom-filters": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/ethereum-bloom-filters/-/ethereum-bloom-filters-1.2.0.tgz", @@ -3809,7 +3846,6 @@ } ], "license": "MIT", - "peer": true, "dependencies": { "@adraffy/ens-normalize": "1.10.1", "@noble/curves": "1.2.0", @@ -3829,7 +3865,6 @@ "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">= 16" }, @@ -3842,16 +3877,14 @@ "resolved": "https://registry.npmjs.org/@types/node/-/node-18.15.13.tgz", "integrity": "sha512-N+0kuo9KgrUQ1Sn/ifDXsvg0TTleP7rIy4zOBGECxAljqvqfqpTfzx0Q1NUedOixRMBfe2Whhb056a42cWs26Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/ethers/node_modules/tslib": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", "dev": true, - "license": "0BSD", - "peer": true + "license": "0BSD" }, "node_modules/ethers/node_modules/ws": { "version": "8.17.1", @@ -3859,7 +3892,6 @@ "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=10.0.0" }, @@ -3915,6 +3947,18 @@ "npm": ">=3" } }, + "node_modules/event-emitter": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.2.2.tgz", + "integrity": "sha512-kdjfxF6jYJ5m/OEe3ZNNJzbCEcagF4lNJeuhgrBSRnlitpdxICDKzCel+Z5Wbl7K9UhBN/7k2MzXBvCvSwfzzg==", + "dev": true, + "dependencies": { + "es5-ext": "~0.9.2" + }, + "engines": { + "node": ">=0.4" + } + }, "node_modules/evp_bytestokey": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", @@ -3931,8 +3975,7 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fast-glob": { "version": "3.3.2", @@ -3965,8 +4008,7 @@ "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.0.1.tgz", "integrity": "sha512-MWipKbbYiYI0UC7cl8m/i/IWTqfC8YXsqjzybjddLsFjStroQzsHXkc73JutMvBiXmOvapk+axIl79ig5t55Bw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/fastq": { "version": "1.17.1", @@ -4066,6 +4108,16 @@ "node": ">= 6" } }, + "node_modules/formidable": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-1.0.14.tgz", + "integrity": "sha512-aOskFHEfYwkSKSzGui5jhQ+uyLo2NTwpzhndggz2YZHlv0HkAi+zG5ZEBCL3GTvqLyr/FzX9Mvx9DueCmu2HzQ==", + "deprecated": "Please upgrade to latest, formidable@v2 or formidable@v3! Check these notes: https://bit.ly/2ZEqIau", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/fp-ts": { "version": "1.19.3", "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-1.19.3.tgz", @@ -4410,6 +4462,15 @@ "hardhat": "^2.0.2" } }, + "node_modules/has-color": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "integrity": "sha512-kaNz5OTAYYmt646Hkqw50/qyxP2vFnTVu5AQ1Zmk22Kk5+4Qx6BpO8+u7IKsML5fOsFk0ZT0AcCJNYwcvaLBvw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/has-flag": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", @@ -4629,7 +4690,6 @@ "integrity": "sha512-Rx3CqeqQ19sxUtYV9CU911Vhy8/721wRFnJv3REVGWUmoAcIwzifTsdmJte/MV+0/XpM35LZdQMBGkRIoLPwQA==", "dev": true, "license": "MIT", - "peer": true, "funding": { "type": "opencollective", "url": "https://opencollective.com/immer" @@ -4679,6 +4739,36 @@ "license": "ISC", "peer": true }, + "node_modules/inquirer": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-0.4.1.tgz", + "integrity": "sha512-q+Im4T6ukccagPS1iGpVoVXA3aqYYOQGEDfGPkvGCsKPxy/WDiXX2BCJMxQqyz5AJp/sGYcnaM6YfwP2s3uxbQ==", + "dev": true, + "dependencies": { + "async": "~0.2.8", + "cli-color": "~0.2.2", + "lodash": "~2.4.1", + "mute-stream": "0.0.4", + "readline2": "~0.1.0", + "through": "~2.3.4" + } + }, + "node_modules/inquirer/node_modules/async": { + "version": "0.2.10", + "resolved": "https://registry.npmjs.org/async/-/async-0.2.10.tgz", + "integrity": "sha512-eAkdoKxU6/LkKDBzLpT+t6Ff5EtfSF4wx1WfJiPEEV7WNLnDaRXk0oVysiEPm262roaachGexwUv94WhSgN5TQ==", + "dev": true + }, + "node_modules/inquirer/node_modules/lodash": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.2.tgz", + "integrity": "sha512-Kak1hi6/hYHGVPmdyiZijoQyz5x2iGVzs6w9GYB/HiXEtylY7tIoYEROMjvM1d9nXJqPOrG2MNPMn01bJ+S0Rw==", + "dev": true, + "engines": [ + "node", + "rhino" + ] + }, "node_modules/interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", @@ -4831,16 +4921,14 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/json-stringify-safe": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", "dev": true, - "license": "ISC", - "peer": true + "license": "ISC" }, "node_modules/jsonfile": { "version": "4.0.0", @@ -4896,7 +4984,6 @@ "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=6" } @@ -4950,24 +5037,21 @@ "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/lodash.truncate": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.truncate/-/lodash.truncate-4.4.2.tgz", "integrity": "sha512-jttmRe7bRse52OsWIMDLaXxWqRAmtIUccAQ3garviCqJjafXOfNMO0yMfNpdD6zbGaTU0P5Nz7e7gAT6cKmJRw==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/log-symbols": { "version": "4.1.0", @@ -5108,6 +5192,20 @@ "safe-buffer": "^5.1.2" } }, + "node_modules/memoizee": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/memoizee/-/memoizee-0.2.6.tgz", + "integrity": "sha512-0VZI0btwyGk6FSDnJGuJtso4M/eSxhVb5ID5AZNWMFFgT2LexCV18hHI764V4ELKlyfnQ5KMQ+q5H3uvFN3MLw==", + "dev": true, + "dependencies": { + "es5-ext": "~0.9.2", + "event-emitter": "~0.2.2", + "next-tick": "0.1.x" + }, + "engines": { + "node": ">=0.4" + } + }, "node_modules/memorystream": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/memorystream/-/memorystream-0.3.1.tgz", @@ -5128,6 +5226,21 @@ "node": ">= 8" } }, + "node_modules/methods": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/methods/-/methods-0.0.1.tgz", + "integrity": "sha512-pB8oFfci/xcfUgM6DTxc7lbTKifPPgs3mZUOsEgaH+1TTWpmcmv3sHl+5sUHIj2X2W8aPYa2+nJealRHK+Lo6A==", + "dev": true + }, + "node_modules/micro-engine": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/micro-engine/-/micro-engine-0.0.1.tgz", + "integrity": "sha512-HdhhNwLLq3Kk5pwKo3x8sS8x6MZDnMq48kMkWzK10/hCJLptUWMVGAFqk3q4qFcdCW4A/qFDw6om7Vaw6FdSEQ==", + "dev": true, + "dependencies": { + "should": "~2.1.1" + } + }, "node_modules/micro-ftch": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/micro-ftch/-/micro-ftch-0.3.1.tgz", @@ -5151,6 +5264,15 @@ "node": ">=8.6" } }, + "node_modules/mime": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.2.5.tgz", + "integrity": "sha512-QfwTOA+zRHSZXxl9Y7ue5ifKDhU1prnh0dO67Vgcl7Lcx0+79vL9A1ln0qtVur8CFSdYq5Zhnw9DDZQgwDh8Ng==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/mime-db": { "version": "1.52.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", @@ -5209,7 +5331,6 @@ "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", "dev": true, "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/ljharb" } @@ -5446,13 +5567,18 @@ "dev": true, "license": "MIT" }, + "node_modules/mute-stream": { + "version": "0.0.4", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.4.tgz", + "integrity": "sha512-amvrY4m/7oZamehMoFi1tbwU/kXbVvRTGM2S7F+PZi3n51Jx+9AcSQ3EQsag3tR+hS2higfgOP/Kl8kri/X52A==", + "dev": true + }, "node_modules/ndjson": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ndjson/-/ndjson-2.0.0.tgz", "integrity": "sha512-nGl7LRGrzugTtaFcJMhLbpzJM6XdivmbkdlaGcrk/LXg2KL/YBC6z1g70xh0/al+oFuVFP8N8kiWRucmeEH/qQ==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "json-stringify-safe": "^5.0.1", "minimist": "^1.2.5", @@ -5475,6 +5601,15 @@ "license": "MIT", "peer": true }, + "node_modules/next-tick": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-0.1.0.tgz", + "integrity": "sha512-I44QWeGCHJTx2D3buhnljvSjmPgJua3zdPGtlCQEvA45t9kS/CaHnlVqidTzHwq8LGXhD2SMezjk4hQgP+32Lg==", + "dev": true, + "engines": { + "node": ">=0.4" + } + }, "node_modules/node-addon-api": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", @@ -5511,7 +5646,6 @@ "integrity": "sha512-l2NNj07e9afPnhAhvgVrCD/oy2Ai1yfLpuo3EpiO1jFTsB4sFz6oIfAfSZyQzVpkZQ9xS8ZS5g1jCBgq4Hwo0g==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=12.19" } @@ -5844,7 +5978,6 @@ "integrity": "sha512-NxNv/kLguCA7p3jE8oL2aEBsrJWgAakBpgmgK6lpPWV+WuOmY6r2/zbAVnP+T8bQlA0nzHXSJSJW0Hq7ylaD2Q==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "kleur": "^3.0.3", "sisteransi": "^1.0.5" @@ -5954,6 +6087,40 @@ "node": ">=8.10.0" } }, + "node_modules/readline2": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/readline2/-/readline2-0.1.1.tgz", + "integrity": "sha512-qs8GGG+hLGMaDOGjd+mDglDoYcHDkjIY7z5RU0/ApsGT0qypyrWskNeemUqD+UxIXiZoMYT5aLwGp4ehoyZhIg==", + "dev": true, + "dependencies": { + "mute-stream": "0.0.4", + "strip-ansi": "^2.0.1" + } + }, + "node_modules/readline2/node_modules/ansi-regex": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-1.1.1.tgz", + "integrity": "sha512-q5i8bFLg2wDfsuR56c1NzlJFPzVD+9mxhDrhqOGigEFa87OZHlF+9dWeGWzVTP/0ECiA/JUGzfzRr2t3eYORRw==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/readline2/node_modules/strip-ansi": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-2.0.1.tgz", + "integrity": "sha512-2h8q2CP3EeOhDJ+jd932PRMpa3/pOJFGoF22J1U/DNbEK2gSW2DqeF46VjCXsSQXhC+k/l8/gaaRBQKL6hUPfQ==", + "dev": true, + "dependencies": { + "ansi-regex": "^1.0.0" + }, + "bin": { + "strip-ansi": "cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/rechoir": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz", @@ -5981,6 +6148,12 @@ "node": ">=6.0.0" } }, + "node_modules/reduce-component": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/reduce-component/-/reduce-component-1.0.1.tgz", + "integrity": "sha512-y0wyCcdQul3hI3xHfIs0vg/jSbboQc/YTOAqaxjFG7At+XSexduuOqBVL9SmOLSwa/ldkbzVzdwuk9s2EKTAZg==", + "dev": true + }, "node_modules/reduce-flatten": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", @@ -6036,7 +6209,6 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==", "dev": true, "license": "MIT", - "peer": true, "engines": { "node": ">=0.10.0" } @@ -6398,6 +6570,15 @@ "node": ">=4" } }, + "node_modules/should": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/should/-/should-2.1.1.tgz", + "integrity": "sha512-w9EBOxgQMNmWxqPgjaCOz21FcuYepdNjTGxw0EyIvibY1CdB4UqHjBqEvN5xj5B+tzwrndTaNFwp79yX2E1cFw==", + "dev": true, + "engines": { + "node": ">= 0.2.0" + } + }, "node_modules/side-channel": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", @@ -6423,8 +6604,7 @@ "resolved": "https://registry.npmjs.org/sisteransi/-/sisteransi-1.0.5.tgz", "integrity": "sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/slash": { "version": "3.0.0", @@ -6443,7 +6623,6 @@ "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "astral-regex": "^2.0.0", @@ -6462,7 +6641,6 @@ "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -6479,7 +6657,6 @@ "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "color-name": "~1.1.4" }, @@ -6492,8 +6669,7 @@ "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true, - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/solc": { "version": "0.8.26", @@ -6627,7 +6803,6 @@ "integrity": "sha512-9NThjpgZnifTkJpzTZ7Eue85S49QwpNhZTq6GRJwObb6jnLFNGB7Qm73V5HewTROPyxD0C29xqmaI68bQtV+hg==", "dev": true, "license": "ISC", - "peer": true, "dependencies": { "readable-stream": "^3.0.0" } @@ -6746,6 +6921,78 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/sudo-block": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/sudo-block/-/sudo-block-0.3.0.tgz", + "integrity": "sha512-Jv0WZsbu61SeFqeIVF6hSLnXELZafaxWLESVKt1XUW4UPMVccmE3n2ojL39OkbgjRnaYe7qHP7APJobeDxvMDw==", + "dev": true, + "dependencies": { + "chalk": "~0.3.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/sudo-block/node_modules/ansi-styles": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-0.2.0.tgz", + "integrity": "sha512-YyQBeLj0juxUC9uUXRpQ1ZAzPT1dnsn5vVeJLHYFq4Ct1p0rymUSyvckKCXCH9I0bh3jWDIETA5nXIaZVKlDyA==", + "dev": true, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/sudo-block/node_modules/chalk": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-0.3.0.tgz", + "integrity": "sha512-OcfgS16PHpCu2Q4TNMtk0aZNx8PyeNiiB+6AgGH91fhT9hJ3v6pIIJ3lxlaOEDHlTm8t3wDe6bDGamvtIokQTg==", + "dev": true, + "dependencies": { + "ansi-styles": "~0.2.0", + "has-color": "~0.1.0" + }, + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/superagent": { + "version": "0.16.0", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-0.16.0.tgz", + "integrity": "sha512-/CJzCPSwbwEK1DJOllhcUHy7/4yuKiWOI5gvvyS38Dz8ZortROdYSrxJSB0f+1kPsOLentwnB61obWpRsro5+A==", + "deprecated": "Please upgrade to v9.0.0+ as we have fixed a public vulnerability with formidable dependency. Note that v9.0.0+ requires Node.js v14.18.0+. See https://github.com/ladjs/superagent/pull/1800 for insight. This project is supported and maintained by the team at Forward Email @ https://forwardemail.net", + "dev": true, + "dependencies": { + "cookiejar": "1.3.0", + "debug": "~0.7.2", + "emitter-component": "1.0.0", + "formidable": "1.0.14", + "methods": "0.0.1", + "mime": "1.2.5", + "qs": "0.6.5", + "reduce-component": "1.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/superagent/node_modules/debug": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-0.7.4.tgz", + "integrity": "sha512-EohAb3+DSHSGx8carOSKJe8G0ayV5/i609OD0J2orCkuyae7SyZSz2aoLmQF2s0Pj5gITDebwPH7GFBlqOUQ1Q==", + "dev": true, + "engines": { + "node": "*" + } + }, + "node_modules/superagent/node_modules/qs": { + "version": "0.6.5", + "resolved": "https://registry.npmjs.org/qs/-/qs-0.6.5.tgz", + "integrity": "sha512-n7wA/f30O3SsOw2BVkGUDzjWMw7kXvQJWKtDdgfq5HJvDoad+Jbc6osN1AQ0Iain5plo9e7Cs5fE+xR+DVkPTw==", + "dev": true, + "engines": { + "node": "*" + } + }, "node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6792,7 +7039,6 @@ "integrity": "sha512-w2sfv80nrAh2VCbqR5AK27wswXhqcck2AhfnNW76beQXskGZ1V12GwS//yYVa3d3fcvAip2OUnbDAjW2k3v9fA==", "dev": true, "license": "BSD-3-Clause", - "peer": true, "dependencies": { "ajv": "^8.0.1", "lodash.truncate": "^4.4.2", @@ -6891,13 +7137,18 @@ "node": ">= 0.12" } }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true + }, "node_modules/through2": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-4.0.2.tgz", "integrity": "sha512-iOqSav00cVxEEICeD7TjLB1sueEL+81Wpzp2bY17uZjZN0pWZPuo4suZ/61VujxmqSGFfgOcNuTZ85QJwNZQpw==", "dev": true, "license": "MIT", - "peer": true, "dependencies": { "readable-stream": "3" } diff --git a/scripts/test-contracts/package.json b/scripts/test-contracts/package.json index ac59de4d0..1419f1e16 100644 --- a/scripts/test-contracts/package.json +++ b/scripts/test-contracts/package.json @@ -9,7 +9,13 @@ "license": "ISC", "description": "", "devDependencies": { + "@nomicfoundation/hardhat-ethers": "^3.0.8", + "@nomicfoundation/hardhat-ignition": "^0.15.5", + "@nomicfoundation/hardhat-ignition-ethers": "^0.15.5", "@nomicfoundation/hardhat-toolbox": "^5.0.0", + "@nomicfoundation/hardhat-verify": "^2.0.10", + "@nomicfoundation/ignition-core": "^0.15.5", + "ether": "^0.0.9", "hardhat": "^2.22.10" }, "dependencies": { From a64772b3a2c52b670c43f61ea68484df6e53335a Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 11 Sep 2024 15:46:41 +0200 Subject: [PATCH 30/57] test evm address reverse --- pallets/evm-accounts/src/tests.rs | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/pallets/evm-accounts/src/tests.rs b/pallets/evm-accounts/src/tests.rs index 0ae79fbb2..df7be171b 100644 --- a/pallets/evm-accounts/src/tests.rs +++ b/pallets/evm-accounts/src/tests.rs @@ -58,6 +58,47 @@ fn eth_address_should_convert_to_full_address_when_bound() { }); } +#[test] +fn evm_address_is_reversible_from_account_id() { + ExtBuilder::default().build().execute_with(|| { + let evm_address = H160::from(hex!["222222ff7Be76052e023Ec1a306fCca8F9659D80"]); + assert_eq!( + EVMAccounts::evm_address(&EVMAccounts::account_id(evm_address)), + evm_address + ); + }); +} + +#[test] +fn account_id_is_reversible_from_evm_address() { + ExtBuilder::default().build().execute_with(|| { + let evm_address = H160::from(hex!["222222ff7Be76052e023Ec1a306fCca8F9659D80"]); + assert_eq!( + EVMAccounts::account_id(EVMAccounts::evm_address(&EVMAccounts::account_id(evm_address))), + EVMAccounts::account_id(evm_address) + ); + }); +} + +#[test] +fn account_id_is_reversible_from_bound_evm_address() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE))); + assert_eq!(EVMAccounts::account_id(EVMAccounts::evm_address(&ALICE)), ALICE); + }); +} + +#[test] +fn bound_evm_address_is_reversible_from_account_id() { + ExtBuilder::default().build().execute_with(|| { + assert_ok!(EVMAccounts::bind_evm_address(RuntimeOrigin::signed(ALICE))); + assert_eq!( + EVMAccounts::evm_address(&EVMAccounts::account_id(EVMAccounts::evm_address(&ALICE))), + EVMAccounts::evm_address(&ALICE) + ); + }); +} + #[test] fn bind_address_should_fail_when_nonce_is_not_zero() { ExtBuilder::default() From 5c536586c339a4821dfa093a62ce78ee6b0af946 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 11 Sep 2024 15:49:07 +0200 Subject: [PATCH 31/57] fix evm address reverse --- pallets/evm-accounts/src/lib.rs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs index efae74a0f..320fd5dbe 100644 --- a/pallets/evm-accounts/src/lib.rs +++ b/pallets/evm-accounts/src/lib.rs @@ -311,6 +311,13 @@ pub mod pallet { } } +impl Pallet { + fn _is_evm_account(account_id: &[u8; 32]) -> bool { + let account_ref = account_id.as_ref(); + &account_ref[0..4] == b"ETH\0" && account_ref[24..32] == [0u8; 8] + } +} + impl InspectEvmAccounts for Pallet where T::AccountId: AsRef<[u8; 32]> + frame_support::traits::IsType, @@ -318,13 +325,17 @@ where /// Returns `True` if the account is EVM truncated account. fn is_evm_account(account_id: T::AccountId) -> bool { let account_ref = account_id.as_ref(); - &account_ref[0..4] == b"ETH\0" && account_ref[24..32] == [0u8; 8] + Self::_is_evm_account(account_ref) } /// Get the EVM address from the substrate address. fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress { let acc = account_id.as_ref(); - EvmAddress::from_slice(&acc[..20]) + if Self::_is_evm_account(&acc) { + EvmAddress::from_slice(&acc[4..24]) + } else { + EvmAddress::from_slice(&acc[..20]) + } } /// Get the truncated address from the EVM address. From 520ba81d3e077d04fc9f1c472c1d5db80ea785d3 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 11 Sep 2024 17:53:46 +0200 Subject: [PATCH 32/57] test native evm account balance --- integration-tests/src/erc20.rs | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/integration-tests/src/erc20.rs b/integration-tests/src/erc20.rs index 7c9190018..caee3d6e7 100644 --- a/integration-tests/src/erc20.rs +++ b/integration-tests/src/erc20.rs @@ -276,6 +276,37 @@ fn alice_should_have_free_balance() { }); } +#[test] +fn native_evm_account_should_have_free_balance() { + TestNet::reset(); + Hydra::execute_with(|| { + let contract = deploy_token_contract(); + let asset = bind_erc20(contract); + assert_ok!( as ERC20>::transfer( + CallContext { + contract, + sender: deployer(), + origin: deployer() + }, + evm_address(), + 100 + )); + + assert_eq!( + Erc20Currency::::balance_of(CallContext::new_view(contract), evm_address()), + 100 + ); + assert_eq!( + Erc20Currency::::free_balance(contract, &EVMAccounts::account_id(evm_address())), + 100 + ); + assert_eq!( + Currencies::free_balance(asset, &EVMAccounts::account_id(evm_address())), + 100 + ); + }); +} + #[test] fn account_should_receive_tokens() { TestNet::reset(); From 917d91d5d941db73e38985eeaf854ca26b887a24 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 11 Sep 2024 22:35:43 +0200 Subject: [PATCH 33/57] currencies accounts runtime api --- .gitignore | 2 +- Cargo.lock | 5 +- launch-configs/chopsticks/hydradx.yml | 30 +++----- launch-configs/chopsticks/nice.yml | 33 +++++++++ pallets/currencies/rpc/runtime-api/Cargo.toml | 6 +- pallets/currencies/rpc/runtime-api/src/lib.rs | 28 ++++++- runtime/hydradx/Cargo.toml | 4 +- runtime/hydradx/src/lib.rs | 74 ++++++++++++++++++- 8 files changed, 152 insertions(+), 30 deletions(-) create mode 100644 launch-configs/chopsticks/nice.yml diff --git a/.gitignore b/.gitignore index 139d1f552..29e248470 100644 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,4 @@ fork-testing/local-raw.json SNAPSHOT* -db.sqlite +db.sqlite* diff --git a/Cargo.lock b/Cargo.lock index 4e9fb92f4..9cc8ec25e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4854,7 +4854,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "257.0.0" +version = "258.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -7861,9 +7861,10 @@ dependencies = [ name = "pallet-currencies-rpc-runtime-api" version = "1.0.0" dependencies = [ + "parity-scale-codec", + "scale-info", "sp-api", "sp-core", - "sp-runtime", "sp-std 14.0.0 (git+https://github.com/paritytech/polkadot-sdk?branch=release-polkadot-v1.7.2)", ] diff --git a/launch-configs/chopsticks/hydradx.yml b/launch-configs/chopsticks/hydradx.yml index 8d865c296..349e5d328 100644 --- a/launch-configs/chopsticks/hydradx.yml +++ b/launch-configs/chopsticks/hydradx.yml @@ -2,45 +2,33 @@ endpoint: wss://rpc.hydradx.cloud mock-signature-host: true #block: 1872160 db: ./db.sqlite -wasm-override: target/release/hydradx_runtime.compact.compressed.wasm +wasm-override: target/release/wbuild/hydradx-runtime/hydradx_runtime.compact.compressed.wasm import-storage: System: Account: - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - providers: 1 data: free: 1000000000000000 Tokens: Accounts: - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 18 # DAI - free: '100000000000000000000' - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 10 # USDT - free: '1000000000000' - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 22 # USDC - free: '1000000000000' - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 5 # DOT - free: '100000000000000000000' - - - - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY - 20 # WETH - free: '100000000000000000000' Council: - Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] + Members: [ 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY ] TechnicalCommittee: - Members: [5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY] + Members: [ 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY ] diff --git a/launch-configs/chopsticks/nice.yml b/launch-configs/chopsticks/nice.yml new file mode 100644 index 000000000..fb112b229 --- /dev/null +++ b/launch-configs/chopsticks/nice.yml @@ -0,0 +1,33 @@ +endpoint: wss://rpc.nice.hydration.cloud +mock-signature-host: true +db: ./db.sqlite +wasm-override: target/release/wbuild/hydradx-runtime/hydradx_runtime.compact.compressed.wasm + +import-storage: + System: + Account: + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - providers: 1 + data: + free: 1000000000000000 + Tokens: + Accounts: + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - 18 # DAI + - free: '100000000000000000000' + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - 10 # USDT + - free: '1000000000000' + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - 22 # USDC + - free: '1000000000000' + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - 5 # DOT + - free: '100000000000000000000' + - - - 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY + - 20 # WETH + - free: '100000000000000000000' + Council: + Members: [ 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY ] + TechnicalCommittee: + Members: [ 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY ] diff --git a/pallets/currencies/rpc/runtime-api/Cargo.toml b/pallets/currencies/rpc/runtime-api/Cargo.toml index ce5384196..e7ee6346f 100644 --- a/pallets/currencies/rpc/runtime-api/Cargo.toml +++ b/pallets/currencies/rpc/runtime-api/Cargo.toml @@ -8,7 +8,8 @@ license = "Apache 2.0" repository = "https://github.com/galacticcouncil/hydration-node" [dependencies] -sp-runtime = { workspace = true } +codec = { workspace = true } +scale-info = { workspace = true } sp-api = { workspace = true } sp-std = { workspace = true } sp-core = { workspace = true } @@ -16,7 +17,8 @@ sp-core = { workspace = true } [features] default = ["std"] std = [ - "sp-runtime/std", + "codec/std", + "scale-info/std", "sp-api/std", "sp-std/std", "sp-core/std", diff --git a/pallets/currencies/rpc/runtime-api/src/lib.rs b/pallets/currencies/rpc/runtime-api/src/lib.rs index a02c055db..822c2345e 100644 --- a/pallets/currencies/rpc/runtime-api/src/lib.rs +++ b/pallets/currencies/rpc/runtime-api/src/lib.rs @@ -1,6 +1,30 @@ #![cfg_attr(not(feature = "std"), no_std)] -use sp_runtime::codec::Codec; +use codec::{Codec, Decode, Encode, MaxEncodedLen}; +use scale_info::TypeInfo; +use sp_core::RuntimeDebug; +use sp_std::vec::Vec; + +#[derive(Encode, Decode, Clone, PartialEq, Eq, Default, RuntimeDebug, MaxEncodedLen, TypeInfo)] +pub struct AccountData { + /// Non-reserved part of the balance. There may still be restrictions on + /// this, but it is the total pool what may in principle be transferred, + /// reserved. + /// + /// This is the only balance that matters in terms of most operations on + /// tokens. + pub free: Balance, + /// Balance which is reserved and may not be used at all. + /// + /// This can still get slashed, but gets slashed last of all. + /// + /// This balance is a 'reserve' balance that other subsystems use in + /// order to set aside tokens that are still 'owned' by the account + /// holder, but which are suspendable. + pub reserved: Balance, + /// The amount that `free` may not drop below when withdrawing. + pub frozen: Balance, +} sp_api::decl_runtime_apis! { pub trait CurrenciesApi where @@ -8,6 +32,8 @@ sp_api::decl_runtime_apis! { AccountId: Codec, Balance: Codec, { + fn account(asset_id: AssetId, who: AccountId) -> AccountData; + fn accounts(who: AccountId) -> Vec<(AssetId, AccountData)>; fn free_balance(asset_id: AssetId, who: AccountId) -> Balance; } } diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index df0097e6e..abc635d96 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "257.0.0" +version = "258.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" @@ -163,7 +163,7 @@ precompile-utils = { workspace = true } module-evm-utility-macro = { workspace = true } ethabi = { workspace = true } hex = { workspace = true } -serde_json = { version = "1.0.117",default-features = false } +serde_json = { version = "1.0.117", default-features = false } [features] default = ["std"] diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 607a3273b..75a406709 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -40,6 +40,8 @@ pub mod xcm; pub use assets::*; pub use governance::*; +use pallet_asset_registry::AssetType; +use pallet_currencies_rpc_runtime_api::AccountData; pub use system::*; pub use xcm::*; @@ -114,7 +116,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 257, + spec_version: 258, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -412,6 +414,76 @@ impl_runtime_apis! { AccountId, Balance, > for Runtime { + fn account(asset_id: AssetId, who: AccountId) -> AccountData { + if asset_id == NativeAssetId::get() { + let data = System::account(&who).data; + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + } else if matches!(AssetRegistry::asset_type(asset_id), Some(AssetKind::Erc20)) { + AccountData { + free: Self::free_balance(asset_id, who), + ..Default::default() + } + } else { + let data = Tokens::accounts(who, asset_id); + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + } + } + + fn accounts(who: AccountId) -> Vec<(AssetId, AccountData)> { + let mut result = Vec::new(); + + let balance = System::account(&who).data; + result.push(( + NativeAssetId::get(), + AccountData { + free: balance.free, + reserved: balance.reserved, + frozen: balance.frozen, + } + )); + + result.extend( + orml_tokens::Accounts::::iter_prefix(&who) + .map(|(asset_id, data)| ( + asset_id, + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + )) + ); + + result.extend( + pallet_asset_registry::Assets::::iter() + .filter(|(_, info)| info.asset_type == AssetType::Erc20) + .filter_map(|(asset_id, _)| { + let free = Self::free_balance(asset_id, who.clone()); + if free > 0 { + Some(( + asset_id, + AccountData { + free, + ..Default::default() + } + )) + } else { + None + } + }) + ); + + result + } + fn free_balance(asset_id: AssetId, who: AccountId) -> Balance { Currencies::free_balance(asset_id, &who) } From 29f1b9e954d176d3168b26a0cd275bd6ffe7116d Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 12 Sep 2024 12:36:45 +0200 Subject: [PATCH 34/57] truncated evm accounts cannot be bound --- pallets/evm-accounts/src/lib.rs | 6 +++++- pallets/evm-accounts/src/tests.rs | 12 ++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs index 320fd5dbe..08bc69958 100644 --- a/pallets/evm-accounts/src/lib.rs +++ b/pallets/evm-accounts/src/lib.rs @@ -142,7 +142,7 @@ pub mod pallet { #[pallet::error] #[cfg_attr(test, derive(PartialEq, Eq))] pub enum Error { - /// EVM Account's nonce is not zero + /// Active EVM account cannot be bound TruncatedAccountAlreadyUsed, /// Address is already bound AddressAlreadyBound, @@ -201,6 +201,10 @@ pub mod pallet { Error::::AddressAlreadyBound ); + ensure!( + !Self::is_evm_account(who.clone()), + Error::::TruncatedAccountAlreadyUsed + ); let nonce = T::EvmNonceProvider::get_nonce(evm_address); ensure!(nonce.is_zero(), Error::::TruncatedAccountAlreadyUsed); diff --git a/pallets/evm-accounts/src/tests.rs b/pallets/evm-accounts/src/tests.rs index df7be171b..dea69a38e 100644 --- a/pallets/evm-accounts/src/tests.rs +++ b/pallets/evm-accounts/src/tests.rs @@ -112,6 +112,18 @@ fn bind_address_should_fail_when_nonce_is_not_zero() { }); } +#[test] +fn bind_address_should_fail_when_binding_evm_truncated_account() { + ExtBuilder::default().build().execute_with(|| { + let evm_address = H160::from(hex!["222222ff7Be76052e023Ec1a306fCca8F9659D80"]); + let account_id = EVMAccounts::account_id(evm_address); + assert_noop!( + EVMAccounts::bind_evm_address(RuntimeOrigin::signed(account_id)), + Error::::TruncatedAccountAlreadyUsed + ); + }); +} + #[test] fn bind_address_should_fail_when_already_bound() { ExtBuilder::default().build().execute_with(|| { From 8dc9e336318d10c58228f728b7cf16bde3364b48 Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 12 Sep 2024 12:51:23 +0200 Subject: [PATCH 35/57] remove impossible test case --- integration-tests/src/evm_permit.rs | 108 +--------------------------- 1 file changed, 1 insertion(+), 107 deletions(-) diff --git a/integration-tests/src/evm_permit.rs b/integration-tests/src/evm_permit.rs index 7e3f496c5..2f1d7cb60 100644 --- a/integration-tests/src/evm_permit.rs +++ b/integration-tests/src/evm_permit.rs @@ -9,9 +9,7 @@ use frame_support::traits::Contains; use frame_support::{assert_noop, assert_ok, sp_runtime::codec::Encode}; use frame_system::RawOrigin; use hydradx_runtime::evm::precompiles::{CALLPERMIT, DISPATCH_ADDR}; -use hydradx_runtime::{ - Balances, Currencies, EVMAccounts, MultiTransactionPayment, Omnipool, RuntimeCall, RuntimeOrigin, Tokens, -}; +use hydradx_runtime::{Balances, Currencies, MultiTransactionPayment, Omnipool, RuntimeCall, RuntimeOrigin, Tokens}; use libsecp256k1::{sign, Message, SecretKey}; use orml_traits::MultiCurrency; use pallet_evm_accounts::EvmNonceProvider; @@ -234,110 +232,6 @@ fn dispatch_permit_fee_should_be_paid_in_hdx_when_no_currency_is_set() { }) } -#[test] -fn fee_should_be_paid_in_hdx_when_permit_is_dispatched_and_address_is_bounded() { - TestNet::reset(); - let user_evm_address = alith_evm_address(); - let user_secret_key = alith_secret_key(); - let user_acc = MockAccount::new(alith_evm_account()); - let treasury_acc = MockAccount::new(Treasury::account_id()); - - Hydra::execute_with(|| { - init_omnipool_with_oracle_for_block_10(); - pallet_transaction_payment::pallet::NextFeeMultiplier::::put( - hydradx_runtime::MinimumMultiplier::get(), - ); - - // Prepare user evm account - bind and fund - assert_ok!(EVMAccounts::bind_evm_address(hydradx_runtime::RuntimeOrigin::signed( - user_acc.address() - ))); - assert_ok!(hydradx_runtime::Currencies::update_balance( - hydradx_runtime::RuntimeOrigin::root(), - user_acc.address(), - HDX, - 100_000_000_000_000i128, - )); - //Fund some DOT to sell in omnipool - assert_ok!(hydradx_runtime::Currencies::update_balance( - hydradx_runtime::RuntimeOrigin::root(), - user_acc.address(), - DOT, - 100_000_000i128, - )); - - let initial_treasury_hdx_balance = treasury_acc.balance(HDX); - let initial_user_hdx_balance = user_acc.balance(HDX); - let initial_user_weth_balance = user_acc.balance(WETH); - let initial_user_dot_balance = user_acc.balance(DOT); - - // just reset the weth balance to 0 - to make sure we dont have enough WETH - assert_ok!(hydradx_runtime::Currencies::update_balance( - hydradx_runtime::RuntimeOrigin::root(), - user_acc.address(), - WETH, - -(initial_user_weth_balance as i128), - )); - let initial_user_weth_balance = user_acc.balance(WETH); - assert_eq!(initial_user_weth_balance, 0); - - let omni_sell = - hydradx_runtime::RuntimeCall::Omnipool(pallet_omnipool::Call::::sell { - asset_in: DOT, - asset_out: WETH, - amount: 10_000_000, - min_buy_amount: 0, - }); - - let gas_limit = 1000000; - let deadline = U256::from(1000000000000u128); - - let permit = - pallet_evm_precompile_call_permit::CallPermitPrecompile::::generate_permit( - CALLPERMIT, - user_evm_address, - DISPATCH_ADDR, - U256::from(0), - omni_sell.encode(), - gas_limit, - U256::zero(), - deadline, - ); - let secret_key = SecretKey::parse(&user_secret_key).unwrap(); - let message = Message::parse(&permit); - let (rs, v) = sign(&message, &secret_key); - - //Execute omnipool via EVM - assert_ok!(MultiTransactionPayment::dispatch_permit( - hydradx_runtime::RuntimeOrigin::none(), - user_evm_address, - DISPATCH_ADDR, - U256::from(0), - omni_sell.encode(), - gas_limit, - deadline, - v.serialize(), - H256::from(rs.r.b32()), - H256::from(rs.s.b32()), - )); - // Verify evm fee amount - let user_hdx_balance = user_acc.balance(HDX); - let fee_amount = initial_user_hdx_balance - user_hdx_balance; - assert!(fee_amount > 0); - let new_treasury_hdx_balance = treasury_acc.balance(HDX); - let treasury_hdx_diff = new_treasury_hdx_balance - initial_treasury_hdx_balance; - assert_eq!(fee_amount, treasury_hdx_diff); - - // Verify omnipool sell - let user_weth_balance = user_acc.balance(WETH); - assert_eq!(user_weth_balance, 3_565_408_466_680); - let user_dot_balance = user_acc.balance(DOT); - assert!(user_dot_balance < initial_user_dot_balance); - let dot_diff = initial_user_dot_balance - user_dot_balance; - assert_eq!(dot_diff, 10_000_000); - }) -} - #[test] fn fee_should_be_paid_in_hdx_when_permit_is_dispatched_and_address_is_not_bounded() { TestNet::reset(); From 4e0ae4c33a86c6dbb6fc5fced0f69a3bd622826e Mon Sep 17 00:00:00 2001 From: Roznovjak Date: Fri, 13 Sep 2024 11:07:43 +0200 Subject: [PATCH 36/57] remove redundant as_ref() --- pallets/evm-accounts/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pallets/evm-accounts/src/lib.rs b/pallets/evm-accounts/src/lib.rs index 08bc69958..5a73237f0 100644 --- a/pallets/evm-accounts/src/lib.rs +++ b/pallets/evm-accounts/src/lib.rs @@ -317,8 +317,7 @@ pub mod pallet { impl Pallet { fn _is_evm_account(account_id: &[u8; 32]) -> bool { - let account_ref = account_id.as_ref(); - &account_ref[0..4] == b"ETH\0" && account_ref[24..32] == [0u8; 8] + &account_id[0..4] == b"ETH\0" && account_id[24..32] == [0u8; 8] } } @@ -335,7 +334,7 @@ where /// Get the EVM address from the substrate address. fn evm_address(account_id: &impl AsRef<[u8; 32]>) -> EvmAddress { let acc = account_id.as_ref(); - if Self::_is_evm_account(&acc) { + if Self::_is_evm_account(acc) { EvmAddress::from_slice(&acc[4..24]) } else { EvmAddress::from_slice(&acc[..20]) From 737dc17a4d963d1ba6d1d1eb2d5797d3c9ef93f5 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 13 Sep 2024 13:38:22 +0200 Subject: [PATCH 37/57] cleaned up contract address impl --- pallets/asset-registry/src/lib.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 90165f01d..8178ff925 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -767,11 +767,12 @@ where T::AssetNativeLocation: Into, { fn contract_address(id: Self::AssetId) -> Option { - if AssetKind::Erc20 == Self::asset_type(id)? { + if Self::asset_type(id)? == AssetKind::Erc20 { let location: MultiLocation = Self::asset_to_location(id).unwrap_or_default().into(); - match location.interior { - X1(AccountKey20 { key, .. }) => Some(key.into()), - _ => Some(Default::default()), + if let X1(AccountKey20 { key, .. }) = location.interior { + Some(key.into()) + } else { + Some(Default::default()) } } else { None From eb517861bdebbfbfa8c005cf97248ec9ba7aacbe Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 20 Sep 2024 16:25:01 +0200 Subject: [PATCH 38/57] check contracts integration tests --- Cargo.lock | 2 + integration-tests/Cargo.toml | 2 + integration-tests/src/contracts.rs | 100 ++++++++ integration-tests/src/lib.rs | 1 + runtime/hydradx/Cargo.toml | 2 +- .../contracts/Address.sol/Address.json | 10 + .../ContractCheck.sol/ContractCheck.json | 56 +++++ scripts/test-contracts/contracts/Address.sol | 220 ++++++++++++++++++ .../contracts/ContractCheck.sol | 18 ++ scripts/test-contracts/hardhat.config.js | 2 +- 10 files changed, 411 insertions(+), 2 deletions(-) create mode 100644 integration-tests/src/contracts.rs create mode 100644 scripts/test-contracts/artifacts/contracts/Address.sol/Address.json create mode 100644 scripts/test-contracts/artifacts/contracts/ContractCheck.sol/ContractCheck.json create mode 100644 scripts/test-contracts/contracts/Address.sol create mode 100644 scripts/test-contracts/contracts/ContractCheck.sol diff --git a/Cargo.lock b/Cargo.lock index 9cc8ec25e..17506343e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11888,6 +11888,8 @@ dependencies = [ "hydradx-runtime", "hydradx-traits", "libsecp256k1", + "module-evm-utility-macro", + "num_enum 0.5.11", "orml-tokens", "orml-traits", "orml-unknown-tokens", diff --git a/integration-tests/Cargo.toml b/integration-tests/Cargo.toml index 1e63147da..c91444843 100644 --- a/integration-tests/Cargo.toml +++ b/integration-tests/Cargo.toml @@ -131,6 +131,8 @@ polkadot-primitives = { workspace = true } polkadot-service = { workspace = true, features = ["full-node"] } polkadot-runtime-parachains = { workspace = true } rococo-runtime = { workspace = true } +module-evm-utility-macro = { workspace = true } +num_enum = { workspace = true } ethabi = { workspace = true } serde_json = { workspace = true } diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs new file mode 100644 index 000000000..922da353d --- /dev/null +++ b/integration-tests/src/contracts.rs @@ -0,0 +1,100 @@ +use crate::evm::native_asset_ethereum_address; +use crate::polkadot_test_net::Hydra; +use crate::polkadot_test_net::TestNet; +use crate::polkadot_test_net::ALICE; +use crate::utils::contracts::deploy_contract; +use hex_literal::hex; +use hydradx_runtime::evm::Executor; +use hydradx_runtime::AccountId; +use hydradx_runtime::EVMAccounts; +use hydradx_runtime::Runtime; +use hydradx_traits::evm::CallContext; +use hydradx_traits::evm::EvmAddress; +use hydradx_traits::evm::InspectEvmAccounts; +use hydradx_traits::evm::EVM; +use num_enum::{IntoPrimitive, TryFromPrimitive}; +use pallet_evm::ExitReason::Succeed; +use sp_core::H256; +use sp_core::{RuntimeDebug, U256}; +use xcm_emulator::Network; +use xcm_emulator::TestExt; + +pub fn deployer() -> EvmAddress { + EVMAccounts::evm_address(&Into::::into(ALICE)) +} + +#[module_evm_utility_macro::generate_function_selector] +#[derive(RuntimeDebug, Eq, PartialEq, TryFromPrimitive, IntoPrimitive)] +#[repr(u32)] +pub enum Function { + IsContract = "isContract(address)", + Check = "check(address)", +} + +fn is_contract(checker: EvmAddress, address: EvmAddress) -> bool { + let mut data = Into::::into(Function::Check).to_be_bytes().to_vec(); + data.extend_from_slice(H256::from(address).as_bytes()); + let context = CallContext { + contract: checker, + sender: Default::default(), + origin: Default::default(), + }; + let (res, _) = Executor::::call(context, data, U256::zero(), 100_000); + match res { + Succeed(_) => true, + _ => false, + } +} + +#[test] +fn contract_check_succeeds_on_deployed_contract() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + + assert_eq!(is_contract(checker, checker), true); + }); +} + +#[test] +fn contract_check_fails_on_eoa() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + + assert_eq!(is_contract(checker, deployer()), false); + }); +} + +#[test] +fn contract_check_fails_on_precompile() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + + assert_eq!(is_contract(checker, native_asset_ethereum_address()), false); + }); +} + +#[test] +fn contract_check_succeeds_on_precompile_with_code() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + pallet_evm::AccountCodes::::insert( + native_asset_ethereum_address(), + &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + ); + assert_eq!(is_contract(checker, native_asset_ethereum_address()), true); + }); +} + +#[test] +fn contract_check_succeeds_on_precompile_with_invalid_code() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + pallet_evm::AccountCodes::::insert(native_asset_ethereum_address(), &hex!["00"][..]); + assert_eq!(is_contract(checker, native_asset_ethereum_address()), true); + }); +} diff --git a/integration-tests/src/lib.rs b/integration-tests/src/lib.rs index ace79c584..c84f26b70 100644 --- a/integration-tests/src/lib.rs +++ b/integration-tests/src/lib.rs @@ -5,6 +5,7 @@ mod asset_registry; mod bonds; mod call_filter; mod circuit_breaker; +mod contracts; mod cross_chain_transfer; mod dca; mod dust; diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index abc635d96..913b9f2f1 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -19,7 +19,7 @@ codec = { workspace = true } scale-info = { version = "2.3.1", default-features = false, features = ["derive"] } smallvec = "1.9.0" log = { workspace = true } -num_enum = { version = "0.5.1", default-features = false } +num_enum = { workspace = true } evm = { workspace = true, features = ["with-codec"] } # local dependencies diff --git a/scripts/test-contracts/artifacts/contracts/Address.sol/Address.json b/scripts/test-contracts/artifacts/contracts/Address.sol/Address.json new file mode 100644 index 000000000..d6948ada8 --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/Address.sol/Address.json @@ -0,0 +1,10 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "Address", + "sourceName": "contracts/Address.sol", + "abi": [], + "bytecode": "0x60566050600b82828239805160001a6073146043577f4e487b7100000000000000000000000000000000000000000000000000000000600052600060045260246000fd5b30600052607381538281f3fe73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a3bd1167f4b64c2712fda719899ee18c248d5045fce5d06bf79bc467f1f56b1064736f6c63430008180033", + "deployedBytecode": "0x73000000000000000000000000000000000000000030146080604052600080fdfea2646970667358221220a3bd1167f4b64c2712fda719899ee18c248d5045fce5d06bf79bc467f1f56b1064736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/scripts/test-contracts/artifacts/contracts/ContractCheck.sol/ContractCheck.json b/scripts/test-contracts/artifacts/contracts/ContractCheck.sol/ContractCheck.json new file mode 100644 index 000000000..7268d734a --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/ContractCheck.sol/ContractCheck.json @@ -0,0 +1,56 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "ContractCheck", + "sourceName": "contracts/ContractCheck.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "addr", + "type": "address" + } + ], + "name": "Checked", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "check", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_addr", + "type": "address" + } + ], + "name": "isContract", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "bytecode": "0x608060405234801561001057600080fd5b506102b3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c8063162790551461003b578063c23697a81461006b575b600080fd5b6100556004803603810190610050919061019d565b610087565b60405161006291906101e5565b60405180910390f35b6100856004803603810190610080919061019d565b610099565b005b600061009282610127565b9050919050565b6100a281610087565b6100e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d89061025d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167fe20314ef67750397f75c06a974fa978eaf8f26660fa2e4c14078f87ed2f9e8d760405160405180910390a250565b600080823b905060008111915050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016a8261013f565b9050919050565b61017a8161015f565b811461018557600080fd5b50565b60008135905061019781610171565b92915050565b6000602082840312156101b3576101b261013a565b5b60006101c184828501610188565b91505092915050565b60008115159050919050565b6101df816101ca565b82525050565b60006020820190506101fa60008301846101d6565b92915050565b600082825260208201905092915050565b7f61646472206973206e6f74206120636f6e747261637400000000000000000000600082015250565b6000610247601683610200565b915061025282610211565b602082019050919050565b600060208201905081810360008301526102768161023a565b905091905056fea2646970667358221220883f143f3e31616be16bf2a0118b6259b1a91e54ed3a7dbd91abad45e20fffd664736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c8063162790551461003b578063c23697a81461006b575b600080fd5b6100556004803603810190610050919061019d565b610087565b60405161006291906101e5565b60405180910390f35b6100856004803603810190610080919061019d565b610099565b005b600061009282610127565b9050919050565b6100a281610087565b6100e1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100d89061025d565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff167fe20314ef67750397f75c06a974fa978eaf8f26660fa2e4c14078f87ed2f9e8d760405160405180910390a250565b600080823b905060008111915050919050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061016a8261013f565b9050919050565b61017a8161015f565b811461018557600080fd5b50565b60008135905061019781610171565b92915050565b6000602082840312156101b3576101b261013a565b5b60006101c184828501610188565b91505092915050565b60008115159050919050565b6101df816101ca565b82525050565b60006020820190506101fa60008301846101d6565b92915050565b600082825260208201905092915050565b7f61646472206973206e6f74206120636f6e747261637400000000000000000000600082015250565b6000610247601683610200565b915061025282610211565b602082019050919050565b600060208201905081810360008301526102768161023a565b905091905056fea2646970667358221220883f143f3e31616be16bf2a0118b6259b1a91e54ed3a7dbd91abad45e20fffd664736f6c63430008180033", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/scripts/test-contracts/contracts/Address.sol b/scripts/test-contracts/contracts/Address.sol new file mode 100644 index 000000000..a4f6d07c3 --- /dev/null +++ b/scripts/test-contracts/contracts/Address.sol @@ -0,0 +1,220 @@ +// SPDX-License-Identifier: MIT +// OpenZeppelin Contracts v4.4.1 (utils/Address.sol) + +pragma solidity ^0.8.0; + +/** + * @dev Collection of functions related to the address type + */ +library Address { + /** + * @dev Returns true if `account` is a contract. + * + * [IMPORTANT] + * ==== + * It is unsafe to assume that an address for which this function returns + * false is an externally-owned account (EOA) and not a contract. + * + * Among others, `isContract` will return false for the following + * types of addresses: + * + * - an externally-owned account + * - a contract in construction + * - an address where a contract will be created + * - an address where a contract lived, but was destroyed + * ==== + */ + function isContract(address account) internal view returns (bool) { + // This method relies on extcodesize, which returns 0 for contracts in + // construction, since the code is only stored at the end of the + // constructor execution. + + uint256 size; + assembly { + size := extcodesize(account) + } + return size > 0; + } + + /** + * @dev Replacement for Solidity's `transfer`: sends `amount` wei to + * `recipient`, forwarding all available gas and reverting on errors. + * + * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost + * of certain opcodes, possibly making contracts go over the 2300 gas limit + * imposed by `transfer`, making them unable to receive funds via + * `transfer`. {sendValue} removes this limitation. + * + * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. + * + * IMPORTANT: because control is transferred to `recipient`, care must be + * taken to not create reentrancy vulnerabilities. Consider using + * {ReentrancyGuard} or the + * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. + */ + function sendValue(address payable recipient, uint256 amount) internal { + require(address(this).balance >= amount, 'Address: insufficient balance'); + + (bool success,) = recipient.call{value: amount}(''); + require(success, 'Address: unable to send value, recipient may have reverted'); + } + + /** + * @dev Performs a Solidity function call using a low level `call`. A + * plain `call` is an unsafe replacement for a function call: use this + * function instead. + * + * If `target` reverts with a revert reason, it is bubbled up by this + * function (like regular Solidity function calls). + * + * Returns the raw returned data. To convert to the expected return value, + * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. + * + * Requirements: + * + * - `target` must be a contract. + * - calling `target` with `data` must not revert. + * + * _Available since v3.1._ + */ + function functionCall(address target, bytes memory data) internal returns (bytes memory) { + return functionCall(target, data, 'Address: low-level call failed'); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with + * `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, 0, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but also transferring `value` wei to `target`. + * + * Requirements: + * + * - the calling contract must have an ETH balance of at least `value`. + * - the called Solidity function must be `payable`. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value + ) internal returns (bytes memory) { + return functionCallWithValue(target, data, value, 'Address: low-level call with value failed'); + } + + /** + * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but + * with `errorMessage` as a fallback revert reason when `target` reverts. + * + * _Available since v3.1._ + */ + function functionCallWithValue( + address target, + bytes memory data, + uint256 value, + string memory errorMessage + ) internal returns (bytes memory) { + require(address(this).balance >= value, 'Address: insufficient balance for call'); + require(isContract(target), 'Address: call to non-contract'); + + (bool success, bytes memory returndata) = target.call{value: value}(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall( + address target, + bytes memory data + ) internal view returns (bytes memory) { + return functionStaticCall(target, data, 'Address: low-level static call failed'); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a static call. + * + * _Available since v3.3._ + */ + function functionStaticCall( + address target, + bytes memory data, + string memory errorMessage + ) internal view returns (bytes memory) { + require(isContract(target), 'Address: static call to non-contract'); + + (bool success, bytes memory returndata) = target.staticcall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) { + return functionDelegateCall(target, data, 'Address: low-level delegate call failed'); + } + + /** + * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`], + * but performing a delegate call. + * + * _Available since v3.4._ + */ + function functionDelegateCall( + address target, + bytes memory data, + string memory errorMessage + ) internal returns (bytes memory) { + require(isContract(target), 'Address: delegate call to non-contract'); + + (bool success, bytes memory returndata) = target.delegatecall(data); + return verifyCallResult(success, returndata, errorMessage); + } + + /** + * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the + * revert reason using the provided one. + * + * _Available since v4.3._ + */ + function verifyCallResult( + bool success, + bytes memory returndata, + string memory errorMessage + ) internal pure returns (bytes memory) { + if (success) { + return returndata; + } else { + // Look for revert reason and bubble it up if present + if (returndata.length > 0) { + // The easiest way to bubble the revert reason is using memory via assembly + + assembly { + let returndata_size := mload(returndata) + revert(add(32, returndata), returndata_size) + } + } else { + revert(errorMessage); + } + } + } +} diff --git a/scripts/test-contracts/contracts/ContractCheck.sol b/scripts/test-contracts/contracts/ContractCheck.sol new file mode 100644 index 000000000..80c718bd0 --- /dev/null +++ b/scripts/test-contracts/contracts/ContractCheck.sol @@ -0,0 +1,18 @@ +// SPDX-License-Identifier: UNLICENSED +pragma solidity ^0.8.24; + +import "./Address.sol"; + +contract ContractCheck { + + event Checked(address indexed addr); + + function isContract(address _addr) public view returns (bool) { + return Address.isContract(_addr); + } + + function check(address _addr) public { + require(isContract(_addr), 'addr is not a contract'); + emit Checked(_addr); + } +} diff --git a/scripts/test-contracts/hardhat.config.js b/scripts/test-contracts/hardhat.config.js index 5e3bfbe2a..f10169b97 100644 --- a/scripts/test-contracts/hardhat.config.js +++ b/scripts/test-contracts/hardhat.config.js @@ -1,7 +1,7 @@ require("@nomicfoundation/hardhat-toolbox"); require("@nomicfoundation/hardhat-verify"); const {vars} = require("hardhat/config"); -const PRIVKEY = vars.get("PRIVKEY"); +const PRIVKEY = vars.get("PRIVKEY", "42d8d953e4f9246093a33e9ca6daa078501012f784adfe4bbed57918ff13be14"); /** @type import('hardhat/config').HardhatUserConfig */ module.exports = { From 105bd1f91fc23d6be30fe01b744ea23e6bf8dbed Mon Sep 17 00:00:00 2001 From: mrq Date: Sat, 21 Sep 2024 01:03:49 +0200 Subject: [PATCH 39/57] test precompile with code --- integration-tests/src/evm.rs | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index d9db0e46b..7212a76f8 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -873,6 +873,49 @@ mod currency_precompile { }); } + #[test] + fn precompile_with_code_transfer_should_work() { + TestNet::reset(); + + Hydra::execute_with(|| { + //Arrange + pallet_evm::AccountCodes::::insert( + native_asset_ethereum_address(), + &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + ); + + assert_ok!(hydradx_runtime::Currencies::update_balance( + hydradx_runtime::RuntimeOrigin::root(), + evm_account(), + HDX, + 100 * UNITS as i128, + )); + + let data = EvmDataWriter::new_with_selector(Function::Transfer) + .write(Address::from(evm_address2())) + .write(U256::from(86u128 * UNITS)) + .build(); + + let mut handle = MockHandle { + input: data, + context: Context { + address: evm_address(), + caller: evm_address(), + apparent_value: U256::from(0), + }, + code_address: native_asset_ethereum_address(), + is_static: false, + }; + + //Act + let result = CurrencyPrecompile::execute(&mut handle); + + //Assert + assert_eq!(result.unwrap().exit_status, ExitSucceed::Returned); + assert_balance!(evm_account2(), HDX, 86u128 * UNITS); + }); + } + #[test] fn precompile_for_currency_approve_allowance_should_fail_as_not_supported() { TestNet::reset(); From 6d78ffea0827f2ccf63c4cc667904a8750605e66 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 24 Sep 2024 01:44:06 +0200 Subject: [PATCH 40/57] code is set for precompiles when the asset is registered --- integration-tests/src/contracts.rs | 24 ++++++++++----- integration-tests/src/evm.rs | 4 +++ pallets/asset-registry/src/lib.rs | 7 ++++- pallets/asset-registry/src/tests/mock.rs | 1 + pallets/otc-settlements/src/mock.rs | 1 + pallets/xyk/src/tests/mock.rs | 1 + runtime/hydradx/src/assets.rs | 2 ++ .../src/evm/precompiles/erc20_mapping.rs | 29 +++++++++++++++++++ runtime/hydradx/src/lib.rs | 2 ++ traits/src/registry.rs | 8 +++++ 10 files changed, 71 insertions(+), 8 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 922da353d..237997889 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -1,4 +1,4 @@ -use crate::evm::native_asset_ethereum_address; +use crate::evm::dai_ethereum_address; use crate::polkadot_test_net::Hydra; use crate::polkadot_test_net::TestNet; use crate::polkadot_test_net::ALICE; @@ -67,12 +67,22 @@ fn contract_check_fails_on_eoa() { } #[test] -fn contract_check_fails_on_precompile() { +fn contract_check_fails_on_precompile_without_code() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + pallet_evm::AccountCodes::::remove(dai_ethereum_address()); + assert_eq!(is_contract(checker, dai_ethereum_address()), false); + }); +} + +#[test] +fn contract_check_succeeds_on_currencies_precompile() { TestNet::reset(); Hydra::execute_with(|| { let checker = deploy_contract("ContractCheck", deployer()); - assert_eq!(is_contract(checker, native_asset_ethereum_address()), false); + assert_eq!(is_contract(checker, dai_ethereum_address()), true); }); } @@ -82,10 +92,10 @@ fn contract_check_succeeds_on_precompile_with_code() { Hydra::execute_with(|| { let checker = deploy_contract("ContractCheck", deployer()); pallet_evm::AccountCodes::::insert( - native_asset_ethereum_address(), + dai_ethereum_address(), &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], ); - assert_eq!(is_contract(checker, native_asset_ethereum_address()), true); + assert_eq!(is_contract(checker, dai_ethereum_address()), true); }); } @@ -94,7 +104,7 @@ fn contract_check_succeeds_on_precompile_with_invalid_code() { TestNet::reset(); Hydra::execute_with(|| { let checker = deploy_contract("ContractCheck", deployer()); - pallet_evm::AccountCodes::::insert(native_asset_ethereum_address(), &hex!["00"][..]); - assert_eq!(is_contract(checker, native_asset_ethereum_address()), true); + pallet_evm::AccountCodes::::insert(dai_ethereum_address(), &hex!["00"][..]); + assert_eq!(is_contract(checker, dai_ethereum_address()), true); }); } diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index 7212a76f8..3dfc7dcc1 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -1732,6 +1732,10 @@ pub fn native_asset_ethereum_address() -> H160 { H160::from(hex!("0000000000000000000000000000000100000000")) } +pub fn dai_ethereum_address() -> H160 { + H160::from(hex!("0000000000000000000000000000000100000002")) +} + pub struct MockHandle { pub input: Vec, pub context: Context, diff --git a/pallets/asset-registry/src/lib.rs b/pallets/asset-registry/src/lib.rs index 8178ff925..577769538 100644 --- a/pallets/asset-registry/src/lib.rs +++ b/pallets/asset-registry/src/lib.rs @@ -50,7 +50,7 @@ use frame_support::BoundedVec; use hydradx_traits::evm::EvmAddress; use hydradx_traits::{ registry::{Create, Inspect, Mutate}, - AssetKind, BoundErc20, + AssetKind, BoundErc20, RegisterAssetHook, }; use orml_traits::GetByKey; use polkadot_xcm::v3::Junction::AccountKey20; @@ -115,6 +115,9 @@ pub mod pallet { #[pallet::constant] type RegExternalWeightMultiplier: Get; + /// Hook executed after new asset is registered + type RegisterAssetHook: RegisterAssetHook; + /// Weight information for the extrinsics type WeightInfo: WeightInfo; } @@ -605,6 +608,8 @@ impl Pallet { Self::do_set_location(asset_id, loc)?; } + T::RegisterAssetHook::on_register_asset(asset_id); + Self::deposit_event(Event::Registered { asset_id, asset_name: details.name.clone(), diff --git a/pallets/asset-registry/src/tests/mock.rs b/pallets/asset-registry/src/tests/mock.rs index d88a2f08d..2e034eb0a 100644 --- a/pallets/asset-registry/src/tests/mock.rs +++ b/pallets/asset-registry/src/tests/mock.rs @@ -113,6 +113,7 @@ impl pallet_asset_registry::Config for Test { type MinStringLimit = RegistryMinStringLimit; type SequentialIdStartAt = SequentialIdStart; type RegExternalWeightMultiplier = frame_support::traits::ConstU64<1>; + type RegisterAssetHook = (); type WeightInfo = (); } diff --git a/pallets/otc-settlements/src/mock.rs b/pallets/otc-settlements/src/mock.rs index 5330cbb06..5cf2d26fa 100644 --- a/pallets/otc-settlements/src/mock.rs +++ b/pallets/otc-settlements/src/mock.rs @@ -300,6 +300,7 @@ impl pallet_asset_registry::Config for Test { type MinStringLimit = MinRegistryStringLimit; type SequentialIdStartAt = SequentialIdOffset; type RegExternalWeightMultiplier = frame_support::traits::ConstU64<1>; + type RegisterAssetHook = (); type WeightInfo = (); } diff --git a/pallets/xyk/src/tests/mock.rs b/pallets/xyk/src/tests/mock.rs index 00aaa71bb..1c6b9b889 100644 --- a/pallets/xyk/src/tests/mock.rs +++ b/pallets/xyk/src/tests/mock.rs @@ -116,6 +116,7 @@ impl pallet_asset_registry::Config for Test { type MinStringLimit = MinRegistryStringLimit; type SequentialIdStartAt = SequentialIdOffset; type RegExternalWeightMultiplier = frame_support::traits::ConstU64<1>; + type RegisterAssetHook = (); type WeightInfo = (); } diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 48efcbbca..c5c54943e 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -45,6 +45,7 @@ use primitives::constants::{ }; use sp_runtime::{traits::Zero, DispatchError, DispatchResult, FixedPointNumber, Percent}; +use crate::evm::precompiles::erc20_mapping::SetCodeForErc20Precompile; use core::ops::RangeInclusive; use frame_support::{ parameter_types, @@ -409,6 +410,7 @@ impl pallet_asset_registry::Config for Runtime { type MinStringLimit = MinRegistryStrLimit; type SequentialIdStartAt = SequentialIdOffset; type RegExternalWeightMultiplier = RegExternalWeightMultiplier; + type RegisterAssetHook = SetCodeForErc20Precompile; type WeightInfo = weights::pallet_asset_registry::HydraWeight; } diff --git a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs index fcb75f1ff..e9e65d20f 100644 --- a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs +++ b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs @@ -20,7 +20,9 @@ // http://www.apache.org/licenses/LICENSE-2.0 use crate::evm::EvmAddress; +use crate::Runtime; use hex_literal::hex; +use hydradx_traits::RegisterAssetHook; use primitive_types::H160; use primitives::AssetId; @@ -69,3 +71,30 @@ pub fn is_asset_address(address: H160) -> bool { &address.to_fixed_bytes()[0..16] == asset_address_prefix } + +pub struct SetCodeForErc20Precompile; + +impl RegisterAssetHook for SetCodeForErc20Precompile { + fn on_register_asset(asset_id: AssetId) { + HydraErc20Mapping::encode_evm_address(asset_id).map(|evm_address| { + pallet_evm::AccountCodes::::insert(evm_address, &hex!["00"][..]); + }); + } +} + +impl frame_support::traits::OnRuntimeUpgrade for SetCodeForErc20Precompile { + fn on_runtime_upgrade() -> frame_support::weights::Weight { + let mut reads = 0; + let mut writes = 0; + pallet_asset_registry::Assets::::iter().for_each(|(asset_id, _)| { + reads += 1; + HydraErc20Mapping::encode_evm_address(asset_id).map(|evm_address| { + if !pallet_evm::AccountCodes::::contains_key(evm_address) { + Self::on_register_asset(asset_id); + writes += 1; + } + }); + }); + ::DbWeight::get().reads_writes(reads, writes) + } +} diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 75a406709..92c48fb6c 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -64,6 +64,7 @@ use sp_std::{convert::From, prelude::*}; use sp_version::NativeVersion; use sp_version::RuntimeVersion; // A few exports that help ease life for downstream crates. +use crate::evm::precompiles::erc20_mapping::SetCodeForErc20Precompile; use frame_support::{ construct_runtime, genesis_builder_helper::{build_config, create_default_config}, @@ -279,6 +280,7 @@ pub type Executive = frame_executive::Executive< frame_support::migrations::RemovePallet::DbWeight>, cumulus_pallet_xcmp_queue::migration::v4::MigrationToV4, pallet_identity::migration::versioned::V0ToV1, // We have currently 379 identities in basllisk, so limit of 450 should be enough + SetCodeForErc20Precompile, ), >; diff --git a/traits/src/registry.rs b/traits/src/registry.rs index 137e765da..ee3212fac 100644 --- a/traits/src/registry.rs +++ b/traits/src/registry.rs @@ -179,3 +179,11 @@ pub trait Mutate: Inspect { pub trait BoundErc20: Inspect { fn contract_address(id: Self::AssetId) -> Option; } + +pub trait RegisterAssetHook { + fn on_register_asset(asset_id: AssetId); +} + +impl RegisterAssetHook for () { + fn on_register_asset(_: AssetId) {} +} From fff3e67d546df85a24f006e054c22a4185c5c2ff Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 24 Sep 2024 02:30:39 +0200 Subject: [PATCH 41/57] 259 --- runtime/hydradx/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 92c48fb6c..4ccb14322 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -117,7 +117,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 258, + spec_version: 259, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From 272e9fb99ec27c33faf4fe0f9cfa101cc8152f12 Mon Sep 17 00:00:00 2001 From: dmoka Date: Tue, 24 Sep 2024 14:56:20 +0200 Subject: [PATCH 42/57] add custom stack state with custom code implementation --- runtime/hydradx/src/assets.rs | 2 +- runtime/hydradx/src/evm/executor.rs | 214 +++++++++++++++++- .../src/evm/precompiles/erc20_mapping.rs | 1 + runtime/hydradx/src/evm/precompiles/mod.rs | 9 +- 4 files changed, 219 insertions(+), 7 deletions(-) diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index d29f48d24..458d770ef 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -442,7 +442,7 @@ impl pallet_asset_registry::Config for Runtime { type MinStringLimit = MinRegistryStrLimit; type SequentialIdStartAt = SequentialIdOffset; type RegExternalWeightMultiplier = RegExternalWeightMultiplier; - type RegisterAssetHook = SetCodeForErc20Precompile; + type RegisterAssetHook = ();//TODO: delete type WeightInfo = weights::pallet_asset_registry::HydraWeight; } diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 9efd5857d..574669804 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -5,12 +5,18 @@ use fp_evm::Vicinity; use frame_support::storage::with_transaction; use frame_support::traits::Get; use hydradx_traits::evm::{CallContext, EVM}; -use pallet_evm::runner::stack::SubstrateStackState; +use pallet_evm::runner::stack::{Recorded, SubstrateStackState}; use pallet_evm::{AddressMapping, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; use sp_std::vec; use sp_std::vec::Vec; +use evm::backend::{Backend, Basic}; +use evm::executor::stack::{StackState}; +use evm::{ExitError, Transfer}; +use hex_literal::hex; +use sp_core::{H256,}; +use crate::evm::precompiles::{is_precompile}; pub struct Executor(sp_std::marker::PhantomData); @@ -28,7 +34,7 @@ where pub fn execute<'config, F>(origin: H160, gas: u64, f: F) -> CallResult where F: for<'precompiles> FnOnce( - &mut StackExecutor<'config, 'precompiles, SubstrateStackState<'_, 'config, T>, T::PrecompilesType>, + &mut StackExecutor<'config, 'precompiles, CustomSubstrateStackState<'_, 'config, T>, T::PrecompilesType>, ) -> (ExitReason, Vec), { let gas_price = U256::one(); @@ -37,7 +43,8 @@ where let config = ::config(); let precompiles = T::PrecompilesValue::get(); let metadata = StackSubstateMetadata::new(gas, config); - let state = SubstrateStackState::new(&vicinity, metadata, None, None); + let inner_state = SubstrateStackState::new(&vicinity, metadata, None, None); + let state = CustomSubstrateStackState::new(inner_state); let account = T::AddressMapping::into_account_id(origin); let nonce = frame_system::Account::::get(account.clone()).nonce; let mut executor = StackExecutor::new_with_precompiles(state, config, &precompiles); @@ -68,3 +75,204 @@ where .unwrap_or((ExitReason::Fatal(Other("TransactionalError".into())), Vec::new())) } } + + + +///CustomSubstrateStackState to override some functionalities we need for our runtime +pub struct CustomSubstrateStackState<'vicinity, 'config, T: Config> { + inner: SubstrateStackState<'vicinity, 'config, T>, +} + +impl<'vicinity, 'config, T: Config> CustomSubstrateStackState<'vicinity, 'config, T> { + pub fn new(inner: SubstrateStackState<'vicinity, 'config, T>) -> Self { + Self { inner } + } +} + +impl<'vicinity, 'config, T: Config> Backend for CustomSubstrateStackState<'vicinity, 'config, T> + where + BalanceOf: TryFrom + Into, +{ + fn gas_price(&self) -> U256 { + self.inner.gas_price() + } + + fn origin(&self) -> H160 { + self.inner.origin() + } + + fn block_hash(&self, number: U256) -> H256 { + self.inner.block_hash(number) + } + + fn block_number(&self) -> U256 { + self.inner.block_number() + } + + fn block_coinbase(&self) -> H160 { + self.inner.block_coinbase() + } + + fn block_timestamp(&self) -> U256 { + self.inner.block_timestamp() + } + + fn block_difficulty(&self) -> U256 { + self.inner.block_difficulty() + } + + fn block_randomness(&self) -> Option { + self.inner.block_randomness() + } + + fn block_gas_limit(&self) -> U256 { + self.inner.block_gas_limit() + } + + fn block_base_fee_per_gas(&self) -> U256 { + self.inner.block_base_fee_per_gas() + } + + fn chain_id(&self) -> U256 { + self.inner.chain_id() + } + + fn exists(&self, address: H160) -> bool { + self.inner.exists(address) + } + + fn basic(&self, address: H160) -> Basic { + self.inner.basic(address) + } + + fn code(&self, address: H160) -> Vec { + if is_precompile(address) { + hex!["00"].to_vec() + } else { + self.inner.code(address) + } + } + + fn storage(&self, address: H160, index: H256) -> H256 { + self.inner.storage(address, index) + } + + fn original_storage(&self, address: H160, index: H256) -> Option { + self.inner.original_storage(address, index) + } +} + +impl<'vicinity, 'config, T: Config> StackState<'config> for CustomSubstrateStackState<'vicinity, 'config, T> + where + BalanceOf: TryFrom + Into, +{ + fn metadata(&self) -> &StackSubstateMetadata<'config> { + self.inner.metadata() + } + + fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config> { + self.inner.metadata_mut() + } + + fn enter(&mut self, gas_limit: u64, is_static: bool) { + self.inner.enter(gas_limit, is_static) + } + + fn exit_commit(&mut self) -> Result<(), ExitError> { + self.inner.exit_commit() + } + + fn exit_revert(&mut self) -> Result<(), ExitError> { + self.inner.exit_revert() + } + + fn exit_discard(&mut self) -> Result<(), ExitError> { + self.inner.exit_discard() + } + + fn is_empty(&self, address: H160) -> bool { + self.inner.is_empty(address) + } + + fn deleted(&self, address: H160) -> bool { + self.inner.deleted(address) + } + + fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError> { + self.inner.inc_nonce(address) + } + + fn set_storage(&mut self, address: H160, index: H256, value: H256) { + self.inner.set_storage(address, index, value) + } + + fn reset_storage(&mut self, address: H160) { + self.inner.reset_storage(address) + } + + fn log(&mut self, address: H160, topics: Vec, data: Vec) { + self.inner.log(address, topics, data) + } + + fn set_deleted(&mut self, address: H160) { + self.inner.set_deleted(address) + } + + fn set_code(&mut self, address: H160, code: Vec) { + self.inner.set_code(address, code) + } + + fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError> { + self.inner.transfer(transfer) + } + + fn reset_balance(&mut self, address: H160) { + self.inner.reset_balance(address) + } + + fn touch(&mut self, address: H160) { + self.inner.touch(address) + } + + fn is_cold(&self, address: H160) -> bool { + self.inner.is_cold(address) + } + + fn is_storage_cold(&self, address: H160, key: H256) -> bool { + self.inner.is_storage_cold(address, key) + } + + fn code_size(&self, address: H160) -> U256 { + self.inner.code_size(address) + } + + fn code_hash(&self, address: H160) -> H256 { + self.inner.code_hash(address) + } + + fn record_external_operation(&mut self, op: evm::ExternalOperation) -> Result<(), ExitError> { + self.inner.record_external_operation(op) + } + + fn record_external_dynamic_opcode_cost( + &mut self, + opcode: evm::Opcode, + gas_cost: evm::gasometer::GasCost, + target: evm::gasometer::StorageTarget, + ) -> Result<(), ExitError> { + self.inner.record_external_dynamic_opcode_cost(opcode, gas_cost, target) + } + + fn record_external_cost( + &mut self, + ref_time: Option, + proof_size: Option, + storage_growth: Option, + ) -> Result<(), ExitError> { + self.inner.record_external_cost(ref_time, proof_size, storage_growth) + } + + fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option) { + self.inner.refund_external_cost(ref_time, proof_size) + } +} \ No newline at end of file diff --git a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs index e9e65d20f..fa5224175 100644 --- a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs +++ b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs @@ -72,6 +72,7 @@ pub fn is_asset_address(address: H160) -> bool { &address.to_fixed_bytes()[0..16] == asset_address_prefix } +//TODO: delete if not used pub struct SetCodeForErc20Precompile; impl RegisterAssetHook for SetCodeForErc20Precompile { diff --git a/runtime/hydradx/src/evm/precompiles/mod.rs b/runtime/hydradx/src/evm/precompiles/mod.rs index 69a29867a..bd1439fa4 100644 --- a/runtime/hydradx/src/evm/precompiles/mod.rs +++ b/runtime/hydradx/src/evm/precompiles/mod.rs @@ -96,7 +96,7 @@ pub const CALLPERMIT: H160 = H160(hex!("000000000000000000000000000000000000080a pub const ETH_PRECOMPILE_END: H160 = BLAKE2F; -fn is_standard_precompile(address: H160) -> bool { +pub fn is_standard_precompile(address: H160) -> bool { !address.is_zero() && address <= ETH_PRECOMPILE_END } @@ -151,14 +151,17 @@ where } fn is_precompile(&self, address: H160, _remaining_gas: u64) -> IsPrecompileResult { - let is_precompile = address == DISPATCH_ADDR || is_asset_address(address) || is_standard_precompile(address); IsPrecompileResult::Answer { - is_precompile, + is_precompile: is_precompile(address), extra_cost: 0, } } } +pub fn is_precompile(address: H160) -> bool { + address == DISPATCH_ADDR || is_asset_address(address) || is_standard_precompile(address) +} + // This is a reimplementation of the upstream u64->H160 conversion // function, made `const` to make our precompile address `const`s a // bit cleaner. It can be removed when upstream has a const conversion From f51d5d91951b6ec21b0720679b4ffe5b155f7b68 Mon Sep 17 00:00:00 2001 From: mrq Date: Tue, 24 Sep 2024 22:26:26 +0200 Subject: [PATCH 43/57] final boss --- integration-tests/src/contracts.rs | 44 ++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 237997889..f8fe671fe 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -2,12 +2,19 @@ use crate::evm::dai_ethereum_address; use crate::polkadot_test_net::Hydra; use crate::polkadot_test_net::TestNet; use crate::polkadot_test_net::ALICE; +use crate::polkadot_test_net::BOB; +use crate::polkadot_test_net::UNITS; +use crate::polkadot_test_net::WETH; use crate::utils::contracts::deploy_contract; +use fp_evm::FeeCalculator; +use frame_support::assert_ok; use hex_literal::hex; use hydradx_runtime::evm::Executor; use hydradx_runtime::AccountId; use hydradx_runtime::EVMAccounts; use hydradx_runtime::Runtime; +use hydradx_runtime::RuntimeEvent; +use hydradx_runtime::System; use hydradx_traits::evm::CallContext; use hydradx_traits::evm::EvmAddress; use hydradx_traits::evm::InspectEvmAccounts; @@ -16,6 +23,7 @@ use num_enum::{IntoPrimitive, TryFromPrimitive}; use pallet_evm::ExitReason::Succeed; use sp_core::H256; use sp_core::{RuntimeDebug, U256}; +use test_utils::expect_events; use xcm_emulator::Network; use xcm_emulator::TestExt; @@ -77,12 +85,44 @@ fn contract_check_fails_on_precompile_without_code() { } #[test] -fn contract_check_succeeds_on_currencies_precompile() { +fn contract_check_should_succeed_when_called_from_extrinsic() { TestNet::reset(); Hydra::execute_with(|| { + // Arrange let checker = deploy_contract("ContractCheck", deployer()); + let mut data = Into::::into(Function::Check).to_be_bytes().to_vec(); + data.extend_from_slice(H256::from(dai_ethereum_address()).as_bytes()); + assert_ok!(EVMAccounts::bind_evm_address(hydradx_runtime::RuntimeOrigin::signed( + BOB.into() + ))); + assert_ok!(hydradx_runtime::Currencies::update_balance( + hydradx_runtime::RuntimeOrigin::root(), + BOB.into(), + WETH, + (10_000_000 * UNITS) as i128, + )); + /// For reference with code set in storage this always succeeds + // pallet_evm::AccountCodes::::insert( + // dai_ethereum_address(), + // &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + // ); - assert_eq!(is_contract(checker, dai_ethereum_address()), true); + // Act + assert_ok!(hydradx_runtime::EVM::call( + hydradx_runtime::RuntimeOrigin::signed(BOB.into()), + EVMAccounts::evm_address(&Into::::into(BOB)), + checker, + data, + U256::from(0), + 1000000, + hydradx_runtime::DynamicEvmFee::min_gas_price().0 * 10, + None, + Some(System::account_nonce(AccountId::from(BOB)).into()), + [].into() + )); + + // Assert + expect_events::(vec![pallet_evm::Event::Executed { address: checker }.into()]); }); } From f1829d28f8bee8ef07fd12c97e94412225ff2ca3 Mon Sep 17 00:00:00 2001 From: dmoka Date: Wed, 25 Sep 2024 08:20:19 +0200 Subject: [PATCH 44/57] add custom implementation for code size too as we need to use our custom code implementation there --- integration-tests/src/contracts.rs | 10 --------- runtime/hydradx/src/evm/executor.rs | 35 ++++++++++++++++++++++++++--- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 237997889..cd20b253b 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -66,16 +66,6 @@ fn contract_check_fails_on_eoa() { }); } -#[test] -fn contract_check_fails_on_precompile_without_code() { - TestNet::reset(); - Hydra::execute_with(|| { - let checker = deploy_contract("ContractCheck", deployer()); - pallet_evm::AccountCodes::::remove(dai_ethereum_address()); - assert_eq!(is_contract(checker, dai_ethereum_address()), false); - }); -} - #[test] fn contract_check_succeeds_on_currencies_precompile() { TestNet::reset(); diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 574669804..50b8e3836 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -5,8 +5,8 @@ use fp_evm::Vicinity; use frame_support::storage::with_transaction; use frame_support::traits::Get; use hydradx_traits::evm::{CallContext, EVM}; -use pallet_evm::runner::stack::{Recorded, SubstrateStackState}; -use pallet_evm::{AddressMapping, Config}; +use pallet_evm::runner::stack::{SubstrateStackState}; +use pallet_evm::{AccountCodesMetadata, AddressMapping, CodeMetadata, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; use sp_std::vec; @@ -243,7 +243,36 @@ impl<'vicinity, 'config, T: Config> StackState<'config> for CustomSubstrateStack } fn code_size(&self, address: H160) -> U256 { - self.inner.code_size(address) + let meta = { + //The original (super) code_size logic is copied, with the only difference that we use our custom code(address) function + if let Some(meta) = >::get(address) { + meta + } else { + let code = self.code(address); + + // If code is empty we return precomputed hash for empty code. + // We don't store it as this address could get code deployed in the future. + if code.is_empty() { + const EMPTY_CODE_HASH: [u8; 32] = hex_literal::hex!( + "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" + ); + CodeMetadata { + size: 0, + hash: EMPTY_CODE_HASH.into(), + } + } else { + let size = code.len() as u64; + let hash = H256::from(sp_io::hashing::keccak_256(&code)); + + let meta = CodeMetadata { size, hash }; + + >::insert(address, meta); + meta + } + } + }; + + U256::from(meta.size) } fn code_hash(&self, address: H160) -> H256 { From 5c45679bc20fa12ecbdab1a3a2df19baf2bccf6d Mon Sep 17 00:00:00 2001 From: dmoka Date: Wed, 25 Sep 2024 08:25:14 +0200 Subject: [PATCH 45/57] resolve merge conflict manually --- integration-tests/src/contracts.rs | 61 +++++++++++++++++++++++++----- 1 file changed, 51 insertions(+), 10 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 237997889..adafc01b8 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -18,6 +18,15 @@ use sp_core::H256; use sp_core::{RuntimeDebug, U256}; use xcm_emulator::Network; use xcm_emulator::TestExt; +use crate::polkadot_test_net::BOB; +use crate::polkadot_test_net::UNITS; +use crate::polkadot_test_net::WETH; +use hydradx_runtime::RuntimeEvent; +use hydradx_runtime::System; +use fp_evm::FeeCalculator; +use frame_support::assert_ok; +use test_utils::expect_events; + pub fn deployer() -> EvmAddress { EVMAccounts::evm_address(&Into::::into(ALICE)) @@ -66,16 +75,6 @@ fn contract_check_fails_on_eoa() { }); } -#[test] -fn contract_check_fails_on_precompile_without_code() { - TestNet::reset(); - Hydra::execute_with(|| { - let checker = deploy_contract("ContractCheck", deployer()); - pallet_evm::AccountCodes::::remove(dai_ethereum_address()); - assert_eq!(is_contract(checker, dai_ethereum_address()), false); - }); -} - #[test] fn contract_check_succeeds_on_currencies_precompile() { TestNet::reset(); @@ -108,3 +107,45 @@ fn contract_check_succeeds_on_precompile_with_invalid_code() { assert_eq!(is_contract(checker, dai_ethereum_address()), true); }); } + +#[test] +fn contract_check_should_succeed_when_called_from_extrinsic() { + TestNet::reset(); + Hydra::execute_with(|| { + // Arrange + let checker = deploy_contract("ContractCheck", deployer()); + let mut data = Into::::into(Function::Check).to_be_bytes().to_vec(); + data.extend_from_slice(H256::from(dai_ethereum_address()).as_bytes()); + assert_ok!(EVMAccounts::bind_evm_address(hydradx_runtime::RuntimeOrigin::signed( + BOB.into() + ))); + assert_ok!(hydradx_runtime::Currencies::update_balance( + hydradx_runtime::RuntimeOrigin::root(), + BOB.into(), + WETH, + (10_000_000 * UNITS) as i128, + )); + /// For reference with code set in storage this always succeeds + // pallet_evm::AccountCodes::::insert( + // dai_ethereum_address(), + // &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + // ); + + // Act + assert_ok!(hydradx_runtime::EVM::call( + hydradx_runtime::RuntimeOrigin::signed(BOB.into()), + EVMAccounts::evm_address(&Into::::into(BOB)), + checker, + data, + U256::from(0), + 1000000, + hydradx_runtime::DynamicEvmFee::min_gas_price().0 * 10, + None, + Some(System::account_nonce(AccountId::from(BOB)).into()), + [].into() + )); + + // Assert + expect_events::(vec![pallet_evm::Event::Executed { address: checker }.into()]); + }); +} \ No newline at end of file From c144efb982fe8a596a09e3f781ae51bbf4174163 Mon Sep 17 00:00:00 2001 From: dmoka Date: Wed, 25 Sep 2024 12:45:42 +0200 Subject: [PATCH 46/57] add WIP custom runner --- integration-tests/src/contracts.rs | 8 +- runtime/hydradx/src/evm/executor.rs | 525 +++++++++++++++++++++++++++- 2 files changed, 525 insertions(+), 8 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index adafc01b8..74946f231 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -126,10 +126,10 @@ fn contract_check_should_succeed_when_called_from_extrinsic() { (10_000_000 * UNITS) as i128, )); /// For reference with code set in storage this always succeeds - // pallet_evm::AccountCodes::::insert( - // dai_ethereum_address(), - // &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], - // ); + /*pallet_evm::AccountCodes::::insert( + dai_ethereum_address(), + &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + );*/ // Act assert_ok!(hydradx_runtime::EVM::call( diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 50b8e3836..9b1e61eb6 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -1,12 +1,13 @@ -use evm::executor::stack::{StackExecutor, StackSubstateMetadata}; +use std::marker::PhantomData; +use evm::executor::stack::{IsPrecompileResult, PrecompileSet, StackExecutor, StackSubstateMetadata}; use evm::ExitFatal::Other; use evm::ExitReason; -use fp_evm::Vicinity; +use fp_evm::{CallInfo, CreateInfo, ExecutionInfoV2, FeeCalculator, TransactionValidationError, Vicinity, WeightInfo}; use frame_support::storage::with_transaction; use frame_support::traits::Get; use hydradx_traits::evm::{CallContext, EVM}; use pallet_evm::runner::stack::{SubstrateStackState}; -use pallet_evm::{AccountCodesMetadata, AddressMapping, CodeMetadata, Config}; +use pallet_evm::{AccountCodes, AccountCodesMetadata, AddressMapping, CodeMetadata, Config, Error, Log, OnChargeEVMTransaction, Runner, RunnerError}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; use sp_std::vec; @@ -14,6 +15,7 @@ use sp_std::vec::Vec; use evm::backend::{Backend, Basic}; use evm::executor::stack::{StackState}; use evm::{ExitError, Transfer}; +use frame_support::weights::Weight; use hex_literal::hex; use sp_core::{H256,}; use crate::evm::precompiles::{is_precompile}; @@ -80,7 +82,7 @@ where ///CustomSubstrateStackState to override some functionalities we need for our runtime pub struct CustomSubstrateStackState<'vicinity, 'config, T: Config> { - inner: SubstrateStackState<'vicinity, 'config, T>, + pub inner: SubstrateStackState<'vicinity, 'config, T>, } impl<'vicinity, 'config, T: Config> CustomSubstrateStackState<'vicinity, 'config, T> { @@ -304,4 +306,519 @@ impl<'vicinity, 'config, T: Config> StackState<'config> for CustomSubstrateStack fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option) { self.inner.refund_external_cost(ref_time, proof_size) } +} + +use pallet_evm::{runner::stack::Runner as StackRunner}; + + +use pallet_evm::runner::Runner as RunnerT; + +#[derive(Default)] +pub struct CustomRunner { + _marker: PhantomData, +} + +impl CustomRunner + where + BalanceOf: TryFrom + Into, +{ + #[allow(clippy::let_and_return)] + fn execute<'config, 'precompiles, F, R>( + source: H160, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + config: &'config evm::Config, + precompiles: &'precompiles T::PrecompilesType, + is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, + f: F, + ) -> Result, RunnerError>> + where + F: FnOnce( + &mut StackExecutor< + 'config, + 'precompiles, + CustomSubstrateStackState<'_, 'config, T>, + T::PrecompilesType, + >, + ) -> (ExitReason, R), + R: Default, + { + let (base_fee, weight) = T::FeeCalculator::min_gas_price(); + + #[cfg(not(feature = "forbid-evm-reentrancy"))] + let res = Self::execute_inner( + source, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + config, + precompiles, + is_transactional, + f, + base_fee, + weight, + weight_limit, + proof_size_base_cost, + ); + + #[cfg(feature = "forbid-evm-reentrancy")] + let res = IN_EVM::using_once(&mut false, || { + IN_EVM::with(|in_evm| { + if *in_evm { + return Err(RunnerError { + error: Error::::Reentrancy, + weight, + }); + } + *in_evm = true; + Ok(()) + }) + .unwrap_or(Ok(()))?; + + sp_core::defer! { + IN_EVM::with(|in_evm| { + *in_evm = false; + }); + } + + Self::execute_inner( + source, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + config, + precompiles, + is_transactional, + f, + base_fee, + weight, + weight_limit, + proof_size_base_cost, + ) + }); + + res + } + + fn execute_inner<'config, 'precompiles, F, R>( + source: H160, + value: U256, + mut gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + config: &'config evm::Config, + precompiles: &'precompiles T::PrecompilesType, + is_transactional: bool, + f: F, + base_fee: U256, + weight: Weight, + weight_limit: Option, + proof_size_base_cost: Option, + ) -> Result, RunnerError>> + where + F: FnOnce( + &mut StackExecutor< + 'config, + 'precompiles, + CustomSubstrateStackState<'_, 'config, T>, + T::PrecompilesType, + >, + ) -> (ExitReason, R), + R: Default, + { + let maybe_weight_info = WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost) + .map_err(|_| RunnerError { + error: Error::::GasLimitTooLow, + weight, + })?; + + match precompiles.is_precompile(source, gas_limit) { + IsPrecompileResult::Answer { extra_cost, .. } => { + gas_limit = gas_limit.saturating_sub(extra_cost); + } + IsPrecompileResult::OutOfGas => { + return Ok(ExecutionInfoV2 { + exit_reason: ExitError::OutOfGas.into(), + value: Default::default(), + used_gas: fp_evm::UsedGas { + standard: gas_limit.into(), + effective: gas_limit.into(), + }, + weight_info: maybe_weight_info, + logs: Default::default(), + }) + } + }; + + //TODO: we should use the self::code()?! + if is_transactional && !>::get(source).is_empty() { + return Err(RunnerError { + error: Error::::TransactionMustComeFromEOA, + weight, + }); + } + + let total_fee_per_gas = if is_transactional { + match (max_fee_per_gas, max_priority_fee_per_gas) { + (Some(max_fee), _) if max_fee.is_zero() => U256::zero(), + (Some(_), None) => base_fee, + (Some(max_fee_per_gas), Some(max_priority_fee_per_gas)) => { + let actual_priority_fee_per_gas = max_fee_per_gas + .saturating_sub(base_fee) + .min(max_priority_fee_per_gas); + base_fee.saturating_add(actual_priority_fee_per_gas) + } + _ => { + return Err(RunnerError { + error: Error::::GasPriceTooLow, + weight, + }) + } + } + } else { + Default::default() + }; + + let total_fee = total_fee_per_gas + .checked_mul(U256::from(gas_limit)) + .ok_or(RunnerError { + error: Error::::FeeOverflow, + weight, + })?; + + let fee = T::OnChargeTransaction::withdraw_fee(&source, total_fee) + .map_err(|e| RunnerError { error: e, weight })?; + + let vicinity = Vicinity { + gas_price: base_fee, + origin: source, + }; + + let storage_growth_ratio = T::GasLimitStorageGrowthRatio::get(); + let storage_limit = if storage_growth_ratio > 0 { + Some(gas_limit.saturating_div(storage_growth_ratio)) + } else { + None + }; + + let metadata = StackSubstateMetadata::new(gas_limit, config); + let state = SubstrateStackState::new(&vicinity, metadata, maybe_weight_info, storage_limit); + let custom_state = CustomSubstrateStackState::new(state); + let mut executor = StackExecutor::new_with_precompiles(custom_state, config, precompiles); + + let (reason, retv) = f(&mut executor); + + let storage_gas = 0; + /* + let storage_gas = match &executor.state().inner.storage_meter { + Some(storage_meter) => storage_meter.storage_to_gas(storage_growth_ratio), + None => 0, + };*/ + + let pov_gas = match executor.state().inner.weight_info() { + Some(weight_info) => weight_info + .proof_size_usage + .unwrap_or_default() + .saturating_mul(T::GasLimitPovSizeRatio::get()), + None => 0, + }; + + let used_gas = executor.used_gas(); + let effective_gas = U256::from(sp_std::cmp::max( + sp_std::cmp::max(used_gas, pov_gas), + storage_gas, + )); + + let actual_fee = effective_gas.saturating_mul(total_fee_per_gas); + let actual_base_fee = effective_gas.saturating_mul(base_fee); + + log::debug!( + target: "evm", + "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}]", + reason, + source, + value, + gas_limit, + actual_fee, + used_gas, + effective_gas, + base_fee, + total_fee_per_gas, + is_transactional + ); + + let actual_priority_fee = T::OnChargeTransaction::correct_and_deposit_fee( + &source, + actual_fee, + actual_base_fee, + fee, + ) + .map_err(|e| RunnerError { error: e, weight })?; + T::OnChargeTransaction::pay_priority_fee(actual_priority_fee); + + let state = executor.into_state(); + + //TODO: ADJUST + /*for address in &state.inner.substate.deletes { + log::debug!( + target: "evm", + "Deleting account at {:?}", + address + ); + pallet_evm::Pallet::::remove_account(address) + }*/ + + //TODO: adjust + /*for log in &state.inner.substate.logs { + log::trace!( + target: "evm", + "Inserting log for {:?}, topics ({}) {:?}, data ({}): {:?}]", + log.address, + log.topics.len(), + log.topics, + log.data.len(), + log.data + ); + //TODO: we cant deposit from pallet evm as privde, so we need to do sth else + /* + pallet_evm::Pallet::::deposit_event(Event::::Log { + log: Log { + address: log.address, + topics: log.topics.clone(), + data: log.data.clone(), + }, + });*/ + }*/ + + Ok(ExecutionInfoV2 { + value: retv, + exit_reason: reason, + used_gas: fp_evm::UsedGas { + standard: used_gas.into(), + effective: effective_gas, + }, + weight_info: state.inner.weight_info(), + logs: vec![] //state.inner.substate.logs, //TODO: adjust + }) + } +} + +impl RunnerT for CustomRunner + where + BalanceOf: TryFrom + Into, +{ + type Error = Error; + + fn validate( + source: H160, + target: Option, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + weight_limit: Option, + proof_size_base_cost: Option, + evm_config: &evm::Config, + ) -> Result<(), RunnerError> { + let (base_fee, weight) = T::FeeCalculator::min_gas_price(); + let (source_account, _) = pallet_evm::Pallet::::account_basic(&source); + + fp_evm::CheckEvmTransaction::::new( + fp_evm::CheckEvmTransactionConfig { + evm_config, + block_gas_limit: T::BlockGasLimit::get(), + base_fee, + chain_id: T::ChainId::get(), + is_transactional, + }, + fp_evm::CheckEvmTransactionInput { + chain_id: Some(T::ChainId::get()), + to: target, + input, + nonce: nonce.unwrap_or(source_account.nonce), + gas_limit: gas_limit.into(), + gas_price: None, + max_fee_per_gas, + max_priority_fee_per_gas, + value, + access_list, + }, + weight_limit, + proof_size_base_cost, + ) + .validate_in_block_for(&source_account) + .and_then(|v| v.with_base_fee()) + .and_then(|v| v.with_balance_for(&source_account)) + .map_err(|error| RunnerError { error, weight })?; + Ok(()) + } + + fn call( + source: H160, + target: H160, + input: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + Some(target), + input.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + let precompiles = T::PrecompilesValue::get(); + Self::execute( + source, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + config, + &precompiles, + is_transactional, + weight_limit, + proof_size_base_cost, + |executor| executor.transact_call(source, target, value, input, gas_limit, access_list), + ) + } + + fn create( + source: H160, + init: Vec, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + let precompiles = T::PrecompilesValue::get(); + Self::execute( + source, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + config, + &precompiles, + is_transactional, + weight_limit, + proof_size_base_cost, + |executor| { + let address = executor.create_address(evm::CreateScheme::Legacy { caller: source }); + let (reason, _) = executor.transact_create(source, value, init, gas_limit, access_list); + (reason, address) + }, + ) + } + + fn create2( + source: H160, + init: Vec, + salt: H256, + value: U256, + gas_limit: u64, + max_fee_per_gas: Option, + max_priority_fee_per_gas: Option, + nonce: Option, + access_list: Vec<(H160, Vec)>, + is_transactional: bool, + validate: bool, + weight_limit: Option, + proof_size_base_cost: Option, + config: &evm::Config, + ) -> Result> { + if validate { + Self::validate( + source, + None, + init.clone(), + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + nonce, + access_list.clone(), + is_transactional, + weight_limit, + proof_size_base_cost, + config, + )?; + } + let precompiles = T::PrecompilesValue::get(); + let code_hash = H256::from(sp_io::hashing::keccak_256(&init)); + Self::execute( + source, + value, + gas_limit, + max_fee_per_gas, + max_priority_fee_per_gas, + config, + &precompiles, + is_transactional, + weight_limit, + proof_size_base_cost, + |executor| { + let address = executor.create_address(evm::CreateScheme::Create2 { + caller: source, + code_hash, + salt, + }); + let (reason, _) = executor.transact_create2(source, value, init, salt, gas_limit, access_list); + (reason, address) + }, + ) + } } \ No newline at end of file From 90a212957f0fbb08fd155470181aff5759095b64 Mon Sep 17 00:00:00 2001 From: dmoka Date: Wed, 25 Sep 2024 12:55:28 +0200 Subject: [PATCH 47/57] revert back to relying on AccountCodes storage as otherwise we would need to reinmplement the whole frontier runner and executer which comes with too much work --- integration-tests/src/contracts.rs | 14 +- runtime/hydradx/src/assets.rs | 2 +- runtime/hydradx/src/evm/executor.rs | 750 +----------------- .../src/evm/precompiles/erc20_mapping.rs | 1 - 4 files changed, 15 insertions(+), 752 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 74946f231..b37213bd6 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -98,6 +98,16 @@ fn contract_check_succeeds_on_precompile_with_code() { }); } +#[test] +fn contract_check_fails_on_precompile_without_code() { + TestNet::reset(); + Hydra::execute_with(|| { + let checker = deploy_contract("ContractCheck", deployer()); + pallet_evm::AccountCodes::::remove(dai_ethereum_address()); + assert_eq!(is_contract(checker, dai_ethereum_address()), false); + }); +} + #[test] fn contract_check_succeeds_on_precompile_with_invalid_code() { TestNet::reset(); @@ -126,10 +136,10 @@ fn contract_check_should_succeed_when_called_from_extrinsic() { (10_000_000 * UNITS) as i128, )); /// For reference with code set in storage this always succeeds - /*pallet_evm::AccountCodes::::insert( + pallet_evm::AccountCodes::::insert( dai_ethereum_address(), &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], - );*/ + ); // Act assert_ok!(hydradx_runtime::EVM::call( diff --git a/runtime/hydradx/src/assets.rs b/runtime/hydradx/src/assets.rs index 458d770ef..d29f48d24 100644 --- a/runtime/hydradx/src/assets.rs +++ b/runtime/hydradx/src/assets.rs @@ -442,7 +442,7 @@ impl pallet_asset_registry::Config for Runtime { type MinStringLimit = MinRegistryStrLimit; type SequentialIdStartAt = SequentialIdOffset; type RegExternalWeightMultiplier = RegExternalWeightMultiplier; - type RegisterAssetHook = ();//TODO: delete + type RegisterAssetHook = SetCodeForErc20Precompile; type WeightInfo = weights::pallet_asset_registry::HydraWeight; } diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 9b1e61eb6..47b460a71 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -36,7 +36,7 @@ where pub fn execute<'config, F>(origin: H160, gas: u64, f: F) -> CallResult where F: for<'precompiles> FnOnce( - &mut StackExecutor<'config, 'precompiles, CustomSubstrateStackState<'_, 'config, T>, T::PrecompilesType>, + &mut StackExecutor<'config, 'precompiles, SubstrateStackState<'_, 'config, T>, T::PrecompilesType>, ) -> (ExitReason, Vec), { let gas_price = U256::one(); @@ -45,8 +45,7 @@ where let config = ::config(); let precompiles = T::PrecompilesValue::get(); let metadata = StackSubstateMetadata::new(gas, config); - let inner_state = SubstrateStackState::new(&vicinity, metadata, None, None); - let state = CustomSubstrateStackState::new(inner_state); + let state = SubstrateStackState::new(&vicinity, metadata, None, None); let account = T::AddressMapping::into_account_id(origin); let nonce = frame_system::Account::::get(account.clone()).nonce; let mut executor = StackExecutor::new_with_precompiles(state, config, &precompiles); @@ -76,749 +75,4 @@ where }) .unwrap_or((ExitReason::Fatal(Other("TransactionalError".into())), Vec::new())) } -} - - - -///CustomSubstrateStackState to override some functionalities we need for our runtime -pub struct CustomSubstrateStackState<'vicinity, 'config, T: Config> { - pub inner: SubstrateStackState<'vicinity, 'config, T>, -} - -impl<'vicinity, 'config, T: Config> CustomSubstrateStackState<'vicinity, 'config, T> { - pub fn new(inner: SubstrateStackState<'vicinity, 'config, T>) -> Self { - Self { inner } - } -} - -impl<'vicinity, 'config, T: Config> Backend for CustomSubstrateStackState<'vicinity, 'config, T> - where - BalanceOf: TryFrom + Into, -{ - fn gas_price(&self) -> U256 { - self.inner.gas_price() - } - - fn origin(&self) -> H160 { - self.inner.origin() - } - - fn block_hash(&self, number: U256) -> H256 { - self.inner.block_hash(number) - } - - fn block_number(&self) -> U256 { - self.inner.block_number() - } - - fn block_coinbase(&self) -> H160 { - self.inner.block_coinbase() - } - - fn block_timestamp(&self) -> U256 { - self.inner.block_timestamp() - } - - fn block_difficulty(&self) -> U256 { - self.inner.block_difficulty() - } - - fn block_randomness(&self) -> Option { - self.inner.block_randomness() - } - - fn block_gas_limit(&self) -> U256 { - self.inner.block_gas_limit() - } - - fn block_base_fee_per_gas(&self) -> U256 { - self.inner.block_base_fee_per_gas() - } - - fn chain_id(&self) -> U256 { - self.inner.chain_id() - } - - fn exists(&self, address: H160) -> bool { - self.inner.exists(address) - } - - fn basic(&self, address: H160) -> Basic { - self.inner.basic(address) - } - - fn code(&self, address: H160) -> Vec { - if is_precompile(address) { - hex!["00"].to_vec() - } else { - self.inner.code(address) - } - } - - fn storage(&self, address: H160, index: H256) -> H256 { - self.inner.storage(address, index) - } - - fn original_storage(&self, address: H160, index: H256) -> Option { - self.inner.original_storage(address, index) - } -} - -impl<'vicinity, 'config, T: Config> StackState<'config> for CustomSubstrateStackState<'vicinity, 'config, T> - where - BalanceOf: TryFrom + Into, -{ - fn metadata(&self) -> &StackSubstateMetadata<'config> { - self.inner.metadata() - } - - fn metadata_mut(&mut self) -> &mut StackSubstateMetadata<'config> { - self.inner.metadata_mut() - } - - fn enter(&mut self, gas_limit: u64, is_static: bool) { - self.inner.enter(gas_limit, is_static) - } - - fn exit_commit(&mut self) -> Result<(), ExitError> { - self.inner.exit_commit() - } - - fn exit_revert(&mut self) -> Result<(), ExitError> { - self.inner.exit_revert() - } - - fn exit_discard(&mut self) -> Result<(), ExitError> { - self.inner.exit_discard() - } - - fn is_empty(&self, address: H160) -> bool { - self.inner.is_empty(address) - } - - fn deleted(&self, address: H160) -> bool { - self.inner.deleted(address) - } - - fn inc_nonce(&mut self, address: H160) -> Result<(), ExitError> { - self.inner.inc_nonce(address) - } - - fn set_storage(&mut self, address: H160, index: H256, value: H256) { - self.inner.set_storage(address, index, value) - } - - fn reset_storage(&mut self, address: H160) { - self.inner.reset_storage(address) - } - - fn log(&mut self, address: H160, topics: Vec, data: Vec) { - self.inner.log(address, topics, data) - } - - fn set_deleted(&mut self, address: H160) { - self.inner.set_deleted(address) - } - - fn set_code(&mut self, address: H160, code: Vec) { - self.inner.set_code(address, code) - } - - fn transfer(&mut self, transfer: Transfer) -> Result<(), ExitError> { - self.inner.transfer(transfer) - } - - fn reset_balance(&mut self, address: H160) { - self.inner.reset_balance(address) - } - - fn touch(&mut self, address: H160) { - self.inner.touch(address) - } - - fn is_cold(&self, address: H160) -> bool { - self.inner.is_cold(address) - } - - fn is_storage_cold(&self, address: H160, key: H256) -> bool { - self.inner.is_storage_cold(address, key) - } - - fn code_size(&self, address: H160) -> U256 { - let meta = { - //The original (super) code_size logic is copied, with the only difference that we use our custom code(address) function - if let Some(meta) = >::get(address) { - meta - } else { - let code = self.code(address); - - // If code is empty we return precomputed hash for empty code. - // We don't store it as this address could get code deployed in the future. - if code.is_empty() { - const EMPTY_CODE_HASH: [u8; 32] = hex_literal::hex!( - "c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470" - ); - CodeMetadata { - size: 0, - hash: EMPTY_CODE_HASH.into(), - } - } else { - let size = code.len() as u64; - let hash = H256::from(sp_io::hashing::keccak_256(&code)); - - let meta = CodeMetadata { size, hash }; - - >::insert(address, meta); - meta - } - } - }; - - U256::from(meta.size) - } - - fn code_hash(&self, address: H160) -> H256 { - self.inner.code_hash(address) - } - - fn record_external_operation(&mut self, op: evm::ExternalOperation) -> Result<(), ExitError> { - self.inner.record_external_operation(op) - } - - fn record_external_dynamic_opcode_cost( - &mut self, - opcode: evm::Opcode, - gas_cost: evm::gasometer::GasCost, - target: evm::gasometer::StorageTarget, - ) -> Result<(), ExitError> { - self.inner.record_external_dynamic_opcode_cost(opcode, gas_cost, target) - } - - fn record_external_cost( - &mut self, - ref_time: Option, - proof_size: Option, - storage_growth: Option, - ) -> Result<(), ExitError> { - self.inner.record_external_cost(ref_time, proof_size, storage_growth) - } - - fn refund_external_cost(&mut self, ref_time: Option, proof_size: Option) { - self.inner.refund_external_cost(ref_time, proof_size) - } -} - -use pallet_evm::{runner::stack::Runner as StackRunner}; - - -use pallet_evm::runner::Runner as RunnerT; - -#[derive(Default)] -pub struct CustomRunner { - _marker: PhantomData, -} - -impl CustomRunner - where - BalanceOf: TryFrom + Into, -{ - #[allow(clippy::let_and_return)] - fn execute<'config, 'precompiles, F, R>( - source: H160, - value: U256, - gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - config: &'config evm::Config, - precompiles: &'precompiles T::PrecompilesType, - is_transactional: bool, - weight_limit: Option, - proof_size_base_cost: Option, - f: F, - ) -> Result, RunnerError>> - where - F: FnOnce( - &mut StackExecutor< - 'config, - 'precompiles, - CustomSubstrateStackState<'_, 'config, T>, - T::PrecompilesType, - >, - ) -> (ExitReason, R), - R: Default, - { - let (base_fee, weight) = T::FeeCalculator::min_gas_price(); - - #[cfg(not(feature = "forbid-evm-reentrancy"))] - let res = Self::execute_inner( - source, - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - config, - precompiles, - is_transactional, - f, - base_fee, - weight, - weight_limit, - proof_size_base_cost, - ); - - #[cfg(feature = "forbid-evm-reentrancy")] - let res = IN_EVM::using_once(&mut false, || { - IN_EVM::with(|in_evm| { - if *in_evm { - return Err(RunnerError { - error: Error::::Reentrancy, - weight, - }); - } - *in_evm = true; - Ok(()) - }) - .unwrap_or(Ok(()))?; - - sp_core::defer! { - IN_EVM::with(|in_evm| { - *in_evm = false; - }); - } - - Self::execute_inner( - source, - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - config, - precompiles, - is_transactional, - f, - base_fee, - weight, - weight_limit, - proof_size_base_cost, - ) - }); - - res - } - - fn execute_inner<'config, 'precompiles, F, R>( - source: H160, - value: U256, - mut gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - config: &'config evm::Config, - precompiles: &'precompiles T::PrecompilesType, - is_transactional: bool, - f: F, - base_fee: U256, - weight: Weight, - weight_limit: Option, - proof_size_base_cost: Option, - ) -> Result, RunnerError>> - where - F: FnOnce( - &mut StackExecutor< - 'config, - 'precompiles, - CustomSubstrateStackState<'_, 'config, T>, - T::PrecompilesType, - >, - ) -> (ExitReason, R), - R: Default, - { - let maybe_weight_info = WeightInfo::new_from_weight_limit(weight_limit, proof_size_base_cost) - .map_err(|_| RunnerError { - error: Error::::GasLimitTooLow, - weight, - })?; - - match precompiles.is_precompile(source, gas_limit) { - IsPrecompileResult::Answer { extra_cost, .. } => { - gas_limit = gas_limit.saturating_sub(extra_cost); - } - IsPrecompileResult::OutOfGas => { - return Ok(ExecutionInfoV2 { - exit_reason: ExitError::OutOfGas.into(), - value: Default::default(), - used_gas: fp_evm::UsedGas { - standard: gas_limit.into(), - effective: gas_limit.into(), - }, - weight_info: maybe_weight_info, - logs: Default::default(), - }) - } - }; - - //TODO: we should use the self::code()?! - if is_transactional && !>::get(source).is_empty() { - return Err(RunnerError { - error: Error::::TransactionMustComeFromEOA, - weight, - }); - } - - let total_fee_per_gas = if is_transactional { - match (max_fee_per_gas, max_priority_fee_per_gas) { - (Some(max_fee), _) if max_fee.is_zero() => U256::zero(), - (Some(_), None) => base_fee, - (Some(max_fee_per_gas), Some(max_priority_fee_per_gas)) => { - let actual_priority_fee_per_gas = max_fee_per_gas - .saturating_sub(base_fee) - .min(max_priority_fee_per_gas); - base_fee.saturating_add(actual_priority_fee_per_gas) - } - _ => { - return Err(RunnerError { - error: Error::::GasPriceTooLow, - weight, - }) - } - } - } else { - Default::default() - }; - - let total_fee = total_fee_per_gas - .checked_mul(U256::from(gas_limit)) - .ok_or(RunnerError { - error: Error::::FeeOverflow, - weight, - })?; - - let fee = T::OnChargeTransaction::withdraw_fee(&source, total_fee) - .map_err(|e| RunnerError { error: e, weight })?; - - let vicinity = Vicinity { - gas_price: base_fee, - origin: source, - }; - - let storage_growth_ratio = T::GasLimitStorageGrowthRatio::get(); - let storage_limit = if storage_growth_ratio > 0 { - Some(gas_limit.saturating_div(storage_growth_ratio)) - } else { - None - }; - - let metadata = StackSubstateMetadata::new(gas_limit, config); - let state = SubstrateStackState::new(&vicinity, metadata, maybe_weight_info, storage_limit); - let custom_state = CustomSubstrateStackState::new(state); - let mut executor = StackExecutor::new_with_precompiles(custom_state, config, precompiles); - - let (reason, retv) = f(&mut executor); - - let storage_gas = 0; - /* - let storage_gas = match &executor.state().inner.storage_meter { - Some(storage_meter) => storage_meter.storage_to_gas(storage_growth_ratio), - None => 0, - };*/ - - let pov_gas = match executor.state().inner.weight_info() { - Some(weight_info) => weight_info - .proof_size_usage - .unwrap_or_default() - .saturating_mul(T::GasLimitPovSizeRatio::get()), - None => 0, - }; - - let used_gas = executor.used_gas(); - let effective_gas = U256::from(sp_std::cmp::max( - sp_std::cmp::max(used_gas, pov_gas), - storage_gas, - )); - - let actual_fee = effective_gas.saturating_mul(total_fee_per_gas); - let actual_base_fee = effective_gas.saturating_mul(base_fee); - - log::debug!( - target: "evm", - "Execution {:?} [source: {:?}, value: {}, gas_limit: {}, actual_fee: {}, used_gas: {}, effective_gas: {}, base_fee: {}, total_fee_per_gas: {}, is_transactional: {}]", - reason, - source, - value, - gas_limit, - actual_fee, - used_gas, - effective_gas, - base_fee, - total_fee_per_gas, - is_transactional - ); - - let actual_priority_fee = T::OnChargeTransaction::correct_and_deposit_fee( - &source, - actual_fee, - actual_base_fee, - fee, - ) - .map_err(|e| RunnerError { error: e, weight })?; - T::OnChargeTransaction::pay_priority_fee(actual_priority_fee); - - let state = executor.into_state(); - - //TODO: ADJUST - /*for address in &state.inner.substate.deletes { - log::debug!( - target: "evm", - "Deleting account at {:?}", - address - ); - pallet_evm::Pallet::::remove_account(address) - }*/ - - //TODO: adjust - /*for log in &state.inner.substate.logs { - log::trace!( - target: "evm", - "Inserting log for {:?}, topics ({}) {:?}, data ({}): {:?}]", - log.address, - log.topics.len(), - log.topics, - log.data.len(), - log.data - ); - //TODO: we cant deposit from pallet evm as privde, so we need to do sth else - /* - pallet_evm::Pallet::::deposit_event(Event::::Log { - log: Log { - address: log.address, - topics: log.topics.clone(), - data: log.data.clone(), - }, - });*/ - }*/ - - Ok(ExecutionInfoV2 { - value: retv, - exit_reason: reason, - used_gas: fp_evm::UsedGas { - standard: used_gas.into(), - effective: effective_gas, - }, - weight_info: state.inner.weight_info(), - logs: vec![] //state.inner.substate.logs, //TODO: adjust - }) - } -} - -impl RunnerT for CustomRunner - where - BalanceOf: TryFrom + Into, -{ - type Error = Error; - - fn validate( - source: H160, - target: Option, - input: Vec, - value: U256, - gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - nonce: Option, - access_list: Vec<(H160, Vec)>, - is_transactional: bool, - weight_limit: Option, - proof_size_base_cost: Option, - evm_config: &evm::Config, - ) -> Result<(), RunnerError> { - let (base_fee, weight) = T::FeeCalculator::min_gas_price(); - let (source_account, _) = pallet_evm::Pallet::::account_basic(&source); - - fp_evm::CheckEvmTransaction::::new( - fp_evm::CheckEvmTransactionConfig { - evm_config, - block_gas_limit: T::BlockGasLimit::get(), - base_fee, - chain_id: T::ChainId::get(), - is_transactional, - }, - fp_evm::CheckEvmTransactionInput { - chain_id: Some(T::ChainId::get()), - to: target, - input, - nonce: nonce.unwrap_or(source_account.nonce), - gas_limit: gas_limit.into(), - gas_price: None, - max_fee_per_gas, - max_priority_fee_per_gas, - value, - access_list, - }, - weight_limit, - proof_size_base_cost, - ) - .validate_in_block_for(&source_account) - .and_then(|v| v.with_base_fee()) - .and_then(|v| v.with_balance_for(&source_account)) - .map_err(|error| RunnerError { error, weight })?; - Ok(()) - } - - fn call( - source: H160, - target: H160, - input: Vec, - value: U256, - gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - nonce: Option, - access_list: Vec<(H160, Vec)>, - is_transactional: bool, - validate: bool, - weight_limit: Option, - proof_size_base_cost: Option, - config: &evm::Config, - ) -> Result> { - if validate { - Self::validate( - source, - Some(target), - input.clone(), - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - access_list.clone(), - is_transactional, - weight_limit, - proof_size_base_cost, - config, - )?; - } - let precompiles = T::PrecompilesValue::get(); - Self::execute( - source, - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - config, - &precompiles, - is_transactional, - weight_limit, - proof_size_base_cost, - |executor| executor.transact_call(source, target, value, input, gas_limit, access_list), - ) - } - - fn create( - source: H160, - init: Vec, - value: U256, - gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - nonce: Option, - access_list: Vec<(H160, Vec)>, - is_transactional: bool, - validate: bool, - weight_limit: Option, - proof_size_base_cost: Option, - config: &evm::Config, - ) -> Result> { - if validate { - Self::validate( - source, - None, - init.clone(), - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - access_list.clone(), - is_transactional, - weight_limit, - proof_size_base_cost, - config, - )?; - } - let precompiles = T::PrecompilesValue::get(); - Self::execute( - source, - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - config, - &precompiles, - is_transactional, - weight_limit, - proof_size_base_cost, - |executor| { - let address = executor.create_address(evm::CreateScheme::Legacy { caller: source }); - let (reason, _) = executor.transact_create(source, value, init, gas_limit, access_list); - (reason, address) - }, - ) - } - - fn create2( - source: H160, - init: Vec, - salt: H256, - value: U256, - gas_limit: u64, - max_fee_per_gas: Option, - max_priority_fee_per_gas: Option, - nonce: Option, - access_list: Vec<(H160, Vec)>, - is_transactional: bool, - validate: bool, - weight_limit: Option, - proof_size_base_cost: Option, - config: &evm::Config, - ) -> Result> { - if validate { - Self::validate( - source, - None, - init.clone(), - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - nonce, - access_list.clone(), - is_transactional, - weight_limit, - proof_size_base_cost, - config, - )?; - } - let precompiles = T::PrecompilesValue::get(); - let code_hash = H256::from(sp_io::hashing::keccak_256(&init)); - Self::execute( - source, - value, - gas_limit, - max_fee_per_gas, - max_priority_fee_per_gas, - config, - &precompiles, - is_transactional, - weight_limit, - proof_size_base_cost, - |executor| { - let address = executor.create_address(evm::CreateScheme::Create2 { - caller: source, - code_hash, - salt, - }); - let (reason, _) = executor.transact_create2(source, value, init, salt, gas_limit, access_list); - (reason, address) - }, - ) - } } \ No newline at end of file diff --git a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs index fa5224175..e9e65d20f 100644 --- a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs +++ b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs @@ -72,7 +72,6 @@ pub fn is_asset_address(address: H160) -> bool { &address.to_fixed_bytes()[0..16] == asset_address_prefix } -//TODO: delete if not used pub struct SetCodeForErc20Precompile; impl RegisterAssetHook for SetCodeForErc20Precompile { From e8822056fc1445b85ea4bb8ded59f96b36154f17 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 30 Sep 2024 13:30:23 +0200 Subject: [PATCH 48/57] revert executor to pre dmoka version --- runtime/hydradx/src/evm/executor.rs | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/runtime/hydradx/src/evm/executor.rs b/runtime/hydradx/src/evm/executor.rs index 47b460a71..9efd5857d 100644 --- a/runtime/hydradx/src/evm/executor.rs +++ b/runtime/hydradx/src/evm/executor.rs @@ -1,24 +1,16 @@ -use std::marker::PhantomData; -use evm::executor::stack::{IsPrecompileResult, PrecompileSet, StackExecutor, StackSubstateMetadata}; +use evm::executor::stack::{StackExecutor, StackSubstateMetadata}; use evm::ExitFatal::Other; use evm::ExitReason; -use fp_evm::{CallInfo, CreateInfo, ExecutionInfoV2, FeeCalculator, TransactionValidationError, Vicinity, WeightInfo}; +use fp_evm::Vicinity; use frame_support::storage::with_transaction; use frame_support::traits::Get; use hydradx_traits::evm::{CallContext, EVM}; -use pallet_evm::runner::stack::{SubstrateStackState}; -use pallet_evm::{AccountCodes, AccountCodesMetadata, AddressMapping, CodeMetadata, Config, Error, Log, OnChargeEVMTransaction, Runner, RunnerError}; +use pallet_evm::runner::stack::SubstrateStackState; +use pallet_evm::{AddressMapping, Config}; use primitive_types::{H160, U256}; use sp_runtime::{DispatchError, TransactionOutcome}; use sp_std::vec; use sp_std::vec::Vec; -use evm::backend::{Backend, Basic}; -use evm::executor::stack::{StackState}; -use evm::{ExitError, Transfer}; -use frame_support::weights::Weight; -use hex_literal::hex; -use sp_core::{H256,}; -use crate::evm::precompiles::{is_precompile}; pub struct Executor(sp_std::marker::PhantomData); @@ -75,4 +67,4 @@ where }) .unwrap_or((ExitReason::Fatal(Other("TransactionalError".into())), Vec::new())) } -} \ No newline at end of file +} From e6a3d821202955eaeaa84dfd6cefec97c84bb995 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 30 Sep 2024 13:32:05 +0200 Subject: [PATCH 49/57] proxy init test --- integration-tests/src/contracts.rs | 83 +- integration-tests/src/utils/contracts.rs | 2 +- rococo-local/config-zombienet.json | 13 +- .../Treasury-Controller.json | 385 ++++++++++ .../Treasury-Implementation.json | 718 ++++++++++++++++++ .../TreasuryProxy.sol/TreasuryProxy.json | 238 ++++++ 6 files changed, 1421 insertions(+), 18 deletions(-) create mode 100644 scripts/test-contracts/artifacts/contracts/Treasury-Controller.sol/Treasury-Controller.json create mode 100644 scripts/test-contracts/artifacts/contracts/Treasury-Implementation.sol/Treasury-Implementation.json create mode 100644 scripts/test-contracts/artifacts/contracts/TreasuryProxy.sol/TreasuryProxy.json diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index b37213bd6..7a58cc054 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -2,31 +2,36 @@ use crate::evm::dai_ethereum_address; use crate::polkadot_test_net::Hydra; use crate::polkadot_test_net::TestNet; use crate::polkadot_test_net::ALICE; +use crate::polkadot_test_net::BOB; +use crate::polkadot_test_net::UNITS; +use crate::polkadot_test_net::WETH; use crate::utils::contracts::deploy_contract; +use crate::utils::contracts::deploy_contract_code; +use crate::utils::contracts::get_contract_bytecode; +use fp_evm::ExitReason::Succeed; +use fp_evm::ExitSucceed::Stopped; +use fp_evm::FeeCalculator; +use frame_support::assert_ok; use hex_literal::hex; +use hydradx_runtime::evm::precompiles::handle::EvmDataWriter; +use hydradx_runtime::evm::precompiles::Bytes; use hydradx_runtime::evm::Executor; use hydradx_runtime::AccountId; use hydradx_runtime::EVMAccounts; use hydradx_runtime::Runtime; +use hydradx_runtime::RuntimeEvent; +use hydradx_runtime::System; use hydradx_traits::evm::CallContext; use hydradx_traits::evm::EvmAddress; use hydradx_traits::evm::InspectEvmAccounts; use hydradx_traits::evm::EVM; use num_enum::{IntoPrimitive, TryFromPrimitive}; -use pallet_evm::ExitReason::Succeed; +use pretty_assertions::assert_eq; use sp_core::H256; use sp_core::{RuntimeDebug, U256}; +use test_utils::expect_events; use xcm_emulator::Network; use xcm_emulator::TestExt; -use crate::polkadot_test_net::BOB; -use crate::polkadot_test_net::UNITS; -use crate::polkadot_test_net::WETH; -use hydradx_runtime::RuntimeEvent; -use hydradx_runtime::System; -use fp_evm::FeeCalculator; -use frame_support::assert_ok; -use test_utils::expect_events; - pub fn deployer() -> EvmAddress { EVMAccounts::evm_address(&Into::::into(ALICE)) @@ -38,6 +43,8 @@ pub fn deployer() -> EvmAddress { pub enum Function { IsContract = "isContract(address)", Check = "check(address)", + Initialize = "initialize(address)", + InitializePayload = "initialize(address,address,bytes)", } fn is_contract(checker: EvmAddress, address: EvmAddress) -> bool { @@ -137,8 +144,8 @@ fn contract_check_should_succeed_when_called_from_extrinsic() { )); /// For reference with code set in storage this always succeeds pallet_evm::AccountCodes::::insert( - dai_ethereum_address(), - &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], + dai_ethereum_address(), + &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], ); // Act @@ -158,4 +165,54 @@ fn contract_check_should_succeed_when_called_from_extrinsic() { // Assert expect_events::(vec![pallet_evm::Event::Executed { address: checker }.into()]); }); -} \ No newline at end of file +} + +#[test] +fn proxy_should_be_initialized_correctly() { + TestNet::reset(); + Hydra::execute_with(|| { + // Arrange + let proxy = deploy_contract("TreasuryProxy", deployer()); + let mut controller_code = get_contract_bytecode("Treasury-Controller"); + controller_code.extend_from_slice(H256::from(deployer()).as_bytes()); + let controller = deploy_contract_code(controller_code, deployer()); + let implementation = deploy_contract("Treasury-Implementation", deployer()); + let mut implementation_init = EvmDataWriter::new_with_selector(Function::Initialize) + .write(H256::from(EvmAddress::default())) + .build(); + let (res, _) = Executor::::call( + CallContext { + contract: implementation, + sender: deployer(), + origin: deployer(), + }, + implementation_init, + U256::zero(), + 100_000, + ); + assert_eq!(res, Succeed(Stopped), "Failed to initialize implementation"); + + // Act + let mut payload = EvmDataWriter::new_with_selector(Function::Initialize) + .write(H256::from(implementation)) + .build(); + let mut proxy_init = EvmDataWriter::new_with_selector(Function::InitializePayload) + .write(H256::from(implementation)) + .write(H256::from(deployer())) + .write(Bytes(payload)) + .build(); + let (res, _) = Executor::::call( + CallContext { + contract: proxy, + sender: deployer(), + origin: deployer(), + }, + proxy_init, + U256::zero(), + 1_000_000, + ); + + // Assert + assert_eq!(res, Succeed(Stopped), "Failed to initialize proxy"); + }); +} diff --git a/integration-tests/src/utils/contracts.rs b/integration-tests/src/utils/contracts.rs index 6f645391d..c83820046 100644 --- a/integration-tests/src/utils/contracts.rs +++ b/integration-tests/src/utils/contracts.rs @@ -27,7 +27,7 @@ pub fn deploy_contract_code(code: Vec, deployer: EvmAddress) -> EvmAddress { deployer, code.clone(), U256::zero(), - U256::from(2000000u64), + U256::from(15000000u64), None, None, None, diff --git a/rococo-local/config-zombienet.json b/rococo-local/config-zombienet.json index a407af085..58f6eaae4 100644 --- a/rococo-local/config-zombienet.json +++ b/rococo-local/config-zombienet.json @@ -3,13 +3,15 @@ "provider": "native" }, "relaychain": { - "default_command": "../polkadot-sdk/target/release/polkadot", + "default_command": "../../polkadot-sdk/target/release/polkadot", "chain": "rococo-local", "nodes": [ { "name": "alice", - "command": "../polkadot-sdk/target/release/polkadot", - "args": ["--pruning=archive"], + "command": "../../polkadot-sdk/target/release/polkadot", + "args": [ + "--pruning=archive" + ], "ws_port": 9944, "invulnerable": true }, @@ -41,7 +43,10 @@ { "name": "alice", "command": "../target/release/hydradx", - "args": ["--pruning=archive", "--log=info"], + "args": [ + "--pruning=archive", + "--log=info" + ], "ws_port": 9988, "rpc_port": 9999 }, diff --git a/scripts/test-contracts/artifacts/contracts/Treasury-Controller.sol/Treasury-Controller.json b/scripts/test-contracts/artifacts/contracts/Treasury-Controller.sol/Treasury-Controller.json new file mode 100644 index 000000000..35d2d7a51 --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/Treasury-Controller.sol/Treasury-Controller.json @@ -0,0 +1,385 @@ +{ + "address": "0xFf10e9BC7fBDbc473061824A0CD995fb49cb3A42", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "aaveGovShortTimelock", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + } + ], + "name": "cancelStream", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "contract IERC20", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stopTime", + "type": "uint256" + } + ], + "name": "createStream", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "collector", + "type": "address" + }, + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "funds", + "type": "uint256" + } + ], + "name": "withdrawFromStream", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + } + ], + "transactionHash": "0xd6e1edf02fc92c47cd9e173f59a7e926084487fcb0f1d5114edb460ade868f7a", + "receipt": { + "to": null, + "from": "0x0deFa256f28402E780671CCf4cb8C867eb0Ec534", + "contractAddress": "0xFf10e9BC7fBDbc473061824A0CD995fb49cb3A42", + "transactionIndex": 0, + "gasUsed": "1134600", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000800000000000000800000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000800001004000000000000000000000000000000000020000000000000000000000000000020000000000000000000000000000000000000", + "blockHash": "0x51f1072bfdc0b7d505c32aa7646fb9b8c50568d645caf3c47eac119b0f2a154d", + "transactionHash": "0xd6e1edf02fc92c47cd9e173f59a7e926084487fcb0f1d5114edb460ade868f7a", + "logs": [ + { + "transactionIndex": 0, + "blockNumber": 2125634, + "transactionHash": "0xd6e1edf02fc92c47cd9e173f59a7e926084487fcb0f1d5114edb460ade868f7a", + "address": "0xFf10e9BC7fBDbc473061824A0CD995fb49cb3A42", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x0000000000000000000000000defa256f28402e780671ccf4cb8c867eb0ec534" + ], + "data": "0x", + "logIndex": 0, + "blockHash": "0x51f1072bfdc0b7d505c32aa7646fb9b8c50568d645caf3c47eac119b0f2a154d" + }, + { + "transactionIndex": 0, + "blockNumber": 2125634, + "transactionHash": "0xd6e1edf02fc92c47cd9e173f59a7e926084487fcb0f1d5114edb460ade868f7a", + "address": "0xFf10e9BC7fBDbc473061824A0CD995fb49cb3A42", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000defa256f28402e780671ccf4cb8c867eb0ec534", + "0x0000000000000000000000000defa256f28402e780671ccf4cb8c867eb0ec534" + ], + "data": "0x", + "logIndex": 1, + "blockHash": "0x51f1072bfdc0b7d505c32aa7646fb9b8c50568d645caf3c47eac119b0f2a154d" + } + ], + "blockNumber": 2125634, + "cumulativeGasUsed": "1134600", + "status": 1, + "byzantium": true + }, + "args": [ + "0x0deFa256f28402E780671CCf4cb8C867eb0Ec534" + ], + "numDeployments": 1, + "solcInputHash": "f83ccc030186e5b58439131350431de3", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"aaveGovShortTimelock\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"}],\"name\":\"cancelStream\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"contract IERC20\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stopTime\",\"type\":\"uint256\"}],\"name\":\"createStream\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"collector\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"funds\",\"type\":\"uint256\"}],\"name\":\"withdrawFromStream\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"approve(address,address,address,uint256)\":{\"params\":{\"amount\":\"Allowance to approve*\",\"collector\":\"The collector contract with funds (Aave ecosystem reserve)\",\"recipient\":\"Allowance's recipient\",\"token\":\"The asset address\"}},\"cancelStream(address,uint256)\":{\"params\":{\"collector\":\"The collector contract with funds (Aave ecosystem reserve)\",\"streamId\":\"The id of the stream to cancel\"},\"returns\":{\"_0\":\"bool If the cancellation happened correctly*\"}},\"constructor\":{\"params\":{\"aaveGovShortTimelock\":\"The address of the Aave's governance executor, owning this contract\"}},\"createStream(address,address,uint256,address,uint256,uint256)\":{\"params\":{\"collector\":\"The collector contract with funds (Aave ecosystem reserve)\",\"deposit\":\"Total amount to be streamed\",\"recipient\":\"The recipient of the stream of token\",\"startTime\":\"The unix timestamp for when the stream starts\",\"stopTime\":\"The unix timestamp for when the stream stops\",\"tokenAddress\":\"The ERC20 token to use as streaming asset\"},\"returns\":{\"_0\":\"uint256 The stream id created*\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transfer(address,address,address,uint256)\":{\"params\":{\"amount\":\"Amount to transfer*\",\"collector\":\"The collector contract with funds (Aave ecosystem reserve)\",\"recipient\":\"Transfer's recipient\",\"token\":\"The asset address\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"withdrawFromStream(address,uint256,uint256)\":{\"params\":{\"collector\":\"The collector contract with funds (Aave ecosystem reserve)\",\"funds\":\"Amount to withdraw\",\"streamId\":\"The id of the stream to withdraw tokens from\"},\"returns\":{\"_0\":\"bool If the withdrawal finished properly*\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"approve(address,address,address,uint256)\":{\"notice\":\"Proxy function for ERC20's approve(), pointing to a specific collector contract\"},\"cancelStream(address,uint256)\":{\"notice\":\"Proxy function to cancel a stream of token on a specific collector contract\"},\"constructor\":{\"notice\":\"Constructor.\"},\"createStream(address,address,uint256,address,uint256,uint256)\":{\"notice\":\"Proxy function to create a stream of token on a specific collector contract\"},\"transfer(address,address,address,uint256)\":{\"notice\":\"Proxy function for ERC20's transfer(), pointing to a specific collector contract\"},\"withdrawFromStream(address,uint256,uint256)\":{\"notice\":\"Proxy function to withdraw from a stream of token on a specific collector contract\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveController.sol\":\"AaveEcosystemReserveController\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[]},\"sources\":{\"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.0;\\n\\n/*\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with GSN meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address payable) {\\n return payable(msg.sender);\\n }\\n\\n function _msgData() internal view virtual returns (bytes memory) {\\n this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xc0df5ebb2c3d8b4509464c40a88cc51e5e5f5e4a26fafc909330e9bb2658f641\",\"license\":\"MIT\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0xf57d62241e553696a1324d225663ba2e1a51db0a51ca236d0c1b009d89b6284c\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.0;\\n\\nimport './Context.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\ncontract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n address msgSender = _msgSender();\\n _owner = msgSender;\\n emit OwnershipTransferred(address(0), msgSender);\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(_owner == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n emit OwnershipTransferred(_owner, address(0));\\n _owner = address(0);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n emit OwnershipTransferred(_owner, newOwner);\\n _owner = newOwner;\\n }\\n}\\n\",\"keccak256\":\"0x3ce185c4f579e32006f8893dbfdc1b5d878c0e2cafd1508f7ceb081698bc81f9\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveController.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.10;\\n\\nimport {Ownable} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Ownable.sol';\\nimport {IStreamable} from './interfaces/IStreamable.sol';\\nimport {IAdminControlledEcosystemReserve} from './interfaces/IAdminControlledEcosystemReserve.sol';\\nimport {IAaveEcosystemReserveController} from './interfaces/IAaveEcosystemReserveController.sol';\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\n\\ncontract AaveEcosystemReserveController is Ownable, IAaveEcosystemReserveController {\\n /**\\n * @notice Constructor.\\n * @param aaveGovShortTimelock The address of the Aave's governance executor, owning this contract\\n */\\n constructor(address aaveGovShortTimelock) {\\n transferOwnership(aaveGovShortTimelock);\\n }\\n\\n /// @inheritdoc IAaveEcosystemReserveController\\n function approve(\\n address collector,\\n IERC20 token,\\n address recipient,\\n uint256 amount\\n ) external onlyOwner {\\n IAdminControlledEcosystemReserve(collector).approve(token, recipient, amount);\\n }\\n\\n /// @inheritdoc IAaveEcosystemReserveController\\n function transfer(\\n address collector,\\n IERC20 token,\\n address recipient,\\n uint256 amount\\n ) external onlyOwner {\\n IAdminControlledEcosystemReserve(collector).transfer(token, recipient, amount);\\n }\\n\\n /// @inheritdoc IAaveEcosystemReserveController\\n function createStream(\\n address collector,\\n address recipient,\\n uint256 deposit,\\n IERC20 tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n ) external onlyOwner returns (uint256) {\\n return\\n IStreamable(collector).createStream(\\n recipient,\\n deposit,\\n address(tokenAddress),\\n startTime,\\n stopTime\\n );\\n }\\n\\n /// @inheritdoc IAaveEcosystemReserveController\\n function withdrawFromStream(\\n address collector,\\n uint256 streamId,\\n uint256 funds\\n ) external onlyOwner returns (bool) {\\n return IStreamable(collector).withdrawFromStream(streamId, funds);\\n }\\n\\n /// @inheritdoc IAaveEcosystemReserveController\\n function cancelStream(address collector, uint256 streamId) external onlyOwner returns (bool) {\\n return IStreamable(collector).cancelStream(streamId);\\n }\\n}\\n\",\"keccak256\":\"0x1e8230b1127a72125cf35540420c7a686417773e950b00b9d064bb3b7e5bf6e5\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/interfaces/IAaveEcosystemReserveController.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.10;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\n\\ninterface IAaveEcosystemReserveController {\\n /**\\n * @notice Proxy function for ERC20's approve(), pointing to a specific collector contract\\n * @param collector The collector contract with funds (Aave ecosystem reserve)\\n * @param token The asset address\\n * @param recipient Allowance's recipient\\n * @param amount Allowance to approve\\n **/\\n function approve(address collector, IERC20 token, address recipient, uint256 amount) external;\\n\\n /**\\n * @notice Proxy function for ERC20's transfer(), pointing to a specific collector contract\\n * @param collector The collector contract with funds (Aave ecosystem reserve)\\n * @param token The asset address\\n * @param recipient Transfer's recipient\\n * @param amount Amount to transfer\\n **/\\n function transfer(address collector, IERC20 token, address recipient, uint256 amount) external;\\n\\n /**\\n * @notice Proxy function to create a stream of token on a specific collector contract\\n * @param collector The collector contract with funds (Aave ecosystem reserve)\\n * @param recipient The recipient of the stream of token\\n * @param deposit Total amount to be streamed\\n * @param tokenAddress The ERC20 token to use as streaming asset\\n * @param startTime The unix timestamp for when the stream starts\\n * @param stopTime The unix timestamp for when the stream stops\\n * @return uint256 The stream id created\\n **/\\n function createStream(\\n address collector,\\n address recipient,\\n uint256 deposit,\\n IERC20 tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n ) external returns (uint256);\\n\\n /**\\n * @notice Proxy function to withdraw from a stream of token on a specific collector contract\\n * @param collector The collector contract with funds (Aave ecosystem reserve)\\n * @param streamId The id of the stream to withdraw tokens from\\n * @param funds Amount to withdraw\\n * @return bool If the withdrawal finished properly\\n **/\\n function withdrawFromStream(\\n address collector,\\n uint256 streamId,\\n uint256 funds\\n ) external returns (bool);\\n\\n /**\\n * @notice Proxy function to cancel a stream of token on a specific collector contract\\n * @param collector The collector contract with funds (Aave ecosystem reserve)\\n * @param streamId The id of the stream to cancel\\n * @return bool If the cancellation happened correctly\\n **/\\n function cancelStream(address collector, uint256 streamId) external returns (bool);\\n}\\n\",\"keccak256\":\"0xdaf4bf475ee596cd5fdb2553dbbed0cb72b8a21be7ae14c25a37333fa58229ac\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/interfaces/IAdminControlledEcosystemReserve.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.10;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\n\\ninterface IAdminControlledEcosystemReserve {\\n /** @notice Emitted when the funds admin changes\\n * @param fundsAdmin The new funds admin\\n **/\\n event NewFundsAdmin(address indexed fundsAdmin);\\n\\n /** @notice Returns the mock ETH reference address\\n * @return address The address\\n **/\\n function ETH_MOCK_ADDRESS() external pure returns (address);\\n\\n /**\\n * @notice Return the funds admin, only entity to be able to interact with this contract (controller of reserve)\\n * @return address The address of the funds admin\\n **/\\n function getFundsAdmin() external view returns (address);\\n\\n /**\\n * @dev Function for the funds admin to give ERC20 allowance to other parties\\n * @param token The address of the token to give allowance from\\n * @param recipient Allowance's recipient\\n * @param amount Allowance to approve\\n **/\\n function approve(IERC20 token, address recipient, uint256 amount) external;\\n\\n /**\\n * @notice Function for the funds admin to transfer ERC20 tokens to other parties\\n * @param token The address of the token to transfer\\n * @param recipient Transfer's recipient\\n * @param amount Amount to transfer\\n **/\\n function transfer(IERC20 token, address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0xe826cd01ee12902faac76b8ee3f26745f08134a5c7610d111605cae74a5e3268\",\"license\":\"GPL-3.0\"},\"@aave/periphery-v3/contracts/treasury/interfaces/IStreamable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.10;\\n\\ninterface IStreamable {\\n struct Stream {\\n uint256 deposit;\\n uint256 ratePerSecond;\\n uint256 remainingBalance;\\n uint256 startTime;\\n uint256 stopTime;\\n address recipient;\\n address sender;\\n address tokenAddress;\\n bool isEntity;\\n }\\n\\n event CreateStream(\\n uint256 indexed streamId,\\n address indexed sender,\\n address indexed recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n );\\n\\n event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);\\n\\n event CancelStream(\\n uint256 indexed streamId,\\n address indexed sender,\\n address indexed recipient,\\n uint256 senderBalance,\\n uint256 recipientBalance\\n );\\n\\n function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);\\n\\n function getStream(\\n uint256 streamId\\n )\\n external\\n view\\n returns (\\n address sender,\\n address recipient,\\n uint256 deposit,\\n address token,\\n uint256 startTime,\\n uint256 stopTime,\\n uint256 remainingBalance,\\n uint256 ratePerSecond\\n );\\n\\n function createStream(\\n address recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n ) external returns (uint256 streamId);\\n\\n function withdrawFromStream(uint256 streamId, uint256 funds) external returns (bool);\\n\\n function cancelStream(uint256 streamId) external returns (bool);\\n\\n function initialize(address fundsAdmin) external;\\n}\\n\",\"keccak256\":\"0xe4e14f0dc7e4ffdec867f6b547afa37be968d1f293b57a75ff39eafb09c4d37e\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50604051610d11380380610d1183398101604081905261002f9161017a565b600080546001600160a01b03191633908117825560405190918291600080516020610cf1833981519152908290a3506100678161006d565b506101aa565b6000546001600160a01b031633146100cc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6001600160a01b0381166101315760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016100c3565b600080546040516001600160a01b0380851693921691600080516020610cf183398151915291a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b60006020828403121561018c57600080fd5b81516001600160a01b03811681146101a357600080fd5b9392505050565b610b38806101b96000396000f3fe608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e5578063f18d03cc1461010d578063f2fde38b14610120578063fd59e1341461013357600080fd5b80632f436bfa1461008d57806359eba454146100b5578063715018a6146100ca5780637dc14a8e146100d2575b600080fd5b6100a061009b366004610993565b610154565b60405190151581526020015b60405180910390f35b6100c86100c33660046109c8565b61027b565b005b6100c8610393565b6100a06100e0366004610a19565b610483565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ac565b6100c861011b3660046109c8565b61059d565b6100c861012e366004610a45565b610681565b610146610141366004610a62565b610832565b6040519081526020016100ac565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6040517f7a9b2c6c000000000000000000000000000000000000000000000000000000008152600481018490526024810183905273ffffffffffffffffffffffffffffffffffffffff851690637a9b2c6c906044016020604051808303816000875af115801561024f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102739190610ac7565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fe1f21c6700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015283811660248301526044820183905285169063e1f21c67906064015b600060405180830381600087803b15801561037557600080fd5b505af1158015610389573d6000803e3d6000fd5b5050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610505576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517f6db9241b0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff841690636db9241b906024016020604051808303816000875af1158015610572573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105969190610ac7565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fbeabacc800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015283811660248301526044820183905285169063beabacc89060640161035b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610702576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b73ffffffffffffffffffffffffffffffffffffffff81166107a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101d2565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146108b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fcc1b4bf600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790528581166044830152606482018590526084820184905288169063cc1b4bf69060a4016020604051808303816000875af115801561093f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109639190610ae9565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461099057600080fd5b50565b6000806000606084860312156109a857600080fd5b83356109b38161096e565b95602085013595506040909401359392505050565b600080600080608085870312156109de57600080fd5b84356109e98161096e565b935060208501356109f98161096e565b92506040850135610a098161096e565b9396929550929360600135925050565b60008060408385031215610a2c57600080fd5b8235610a378161096e565b946020939093013593505050565b600060208284031215610a5757600080fd5b81356105968161096e565b60008060008060008060c08789031215610a7b57600080fd5b8635610a868161096e565b95506020870135610a968161096e565b9450604087013593506060870135610aad8161096e565b9598949750929560808101359460a0909101359350915050565b600060208284031215610ad957600080fd5b8151801515811461059657600080fd5b600060208284031215610afb57600080fd5b505191905056fea26469706673582212206af6dda09f7e6417703a87e7c8c4b22128dd9d9c7d7a2419a0486c74aa94f2f764736f6c634300080a00338be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100885760003560e01c80638da5cb5b1161005b5780638da5cb5b146100e5578063f18d03cc1461010d578063f2fde38b14610120578063fd59e1341461013357600080fd5b80632f436bfa1461008d57806359eba454146100b5578063715018a6146100ca5780637dc14a8e146100d2575b600080fd5b6100a061009b366004610993565b610154565b60405190151581526020015b60405180910390f35b6100c86100c33660046109c8565b61027b565b005b6100c8610393565b6100a06100e0366004610a19565b610483565b60005460405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ac565b6100c861011b3660046109c8565b61059d565b6100c861012e366004610a45565b610681565b610146610141366004610a62565b610832565b6040519081526020016100ac565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146101db576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6040517f7a9b2c6c000000000000000000000000000000000000000000000000000000008152600481018490526024810183905273ffffffffffffffffffffffffffffffffffffffff851690637a9b2c6c906044016020604051808303816000875af115801561024f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102739190610ac7565b949350505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146102fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fe1f21c6700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015283811660248301526044820183905285169063e1f21c67906064015b600060405180830381600087803b15801561037557600080fd5b505af1158015610389573d6000803e3d6000fd5b5050505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6000805460405173ffffffffffffffffffffffffffffffffffffffff909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080547fffffffffffffffffffffffff0000000000000000000000000000000000000000169055565b6000805473ffffffffffffffffffffffffffffffffffffffff163314610505576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517f6db9241b0000000000000000000000000000000000000000000000000000000081526004810183905273ffffffffffffffffffffffffffffffffffffffff841690636db9241b906024016020604051808303816000875af1158015610572573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105969190610ac7565b9392505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461061e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fbeabacc800000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015283811660248301526044820183905285169063beabacc89060640161035b565b60005473ffffffffffffffffffffffffffffffffffffffff163314610702576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b73ffffffffffffffffffffffffffffffffffffffff81166107a5576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f646472657373000000000000000000000000000000000000000000000000000060648201526084016101d2565b6000805460405173ffffffffffffffffffffffffffffffffffffffff808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b6000805473ffffffffffffffffffffffffffffffffffffffff1633146108b4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016101d2565b6040517fcc1b4bf600000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8781166004830152602482018790528581166044830152606482018590526084820184905288169063cc1b4bf69060a4016020604051808303816000875af115801561093f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109639190610ae9565b979650505050505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461099057600080fd5b50565b6000806000606084860312156109a857600080fd5b83356109b38161096e565b95602085013595506040909401359392505050565b600080600080608085870312156109de57600080fd5b84356109e98161096e565b935060208501356109f98161096e565b92506040850135610a098161096e565b9396929550929360600135925050565b60008060408385031215610a2c57600080fd5b8235610a378161096e565b946020939093013593505050565b600060208284031215610a5757600080fd5b81356105968161096e565b60008060008060008060c08789031215610a7b57600080fd5b8635610a868161096e565b95506020870135610a968161096e565b9450604087013593506060870135610aad8161096e565b9598949750929560808101359460a0909101359350915050565b600060208284031215610ad957600080fd5b8151801515811461059657600080fd5b600060208284031215610afb57600080fd5b505191905056fea26469706673582212206af6dda09f7e6417703a87e7c8c4b22128dd9d9c7d7a2419a0486c74aa94f2f764736f6c634300080a0033", + "devdoc": { + "kind": "dev", + "methods": { + "approve(address,address,address,uint256)": { + "params": { + "amount": "Allowance to approve*", + "collector": "The collector contract with funds (Aave ecosystem reserve)", + "recipient": "Allowance's recipient", + "token": "The asset address" + } + }, + "cancelStream(address,uint256)": { + "params": { + "collector": "The collector contract with funds (Aave ecosystem reserve)", + "streamId": "The id of the stream to cancel" + }, + "returns": { + "_0": "bool If the cancellation happened correctly*" + } + }, + "constructor": { + "params": { + "aaveGovShortTimelock": "The address of the Aave's governance executor, owning this contract" + } + }, + "createStream(address,address,uint256,address,uint256,uint256)": { + "params": { + "collector": "The collector contract with funds (Aave ecosystem reserve)", + "deposit": "Total amount to be streamed", + "recipient": "The recipient of the stream of token", + "startTime": "The unix timestamp for when the stream starts", + "stopTime": "The unix timestamp for when the stream stops", + "tokenAddress": "The ERC20 token to use as streaming asset" + }, + "returns": { + "_0": "uint256 The stream id created*" + } + }, + "owner()": { + "details": "Returns the address of the current owner." + }, + "renounceOwnership()": { + "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." + }, + "transfer(address,address,address,uint256)": { + "params": { + "amount": "Amount to transfer*", + "collector": "The collector contract with funds (Aave ecosystem reserve)", + "recipient": "Transfer's recipient", + "token": "The asset address" + } + }, + "transferOwnership(address)": { + "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." + }, + "withdrawFromStream(address,uint256,uint256)": { + "params": { + "collector": "The collector contract with funds (Aave ecosystem reserve)", + "funds": "Amount to withdraw", + "streamId": "The id of the stream to withdraw tokens from" + }, + "returns": { + "_0": "bool If the withdrawal finished properly*" + } + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "approve(address,address,address,uint256)": { + "notice": "Proxy function for ERC20's approve(), pointing to a specific collector contract" + }, + "cancelStream(address,uint256)": { + "notice": "Proxy function to cancel a stream of token on a specific collector contract" + }, + "constructor": { + "notice": "Constructor." + }, + "createStream(address,address,uint256,address,uint256,uint256)": { + "notice": "Proxy function to create a stream of token on a specific collector contract" + }, + "transfer(address,address,address,uint256)": { + "notice": "Proxy function for ERC20's transfer(), pointing to a specific collector contract" + }, + "withdrawFromStream(address,uint256,uint256)": { + "notice": "Proxy function to withdraw from a stream of token on a specific collector contract" + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 1472, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveController.sol:AaveEcosystemReserveController", + "label": "_owner", + "offset": 0, + "slot": "0", + "type": "t_address" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + } + } + } +} \ No newline at end of file diff --git a/scripts/test-contracts/artifacts/contracts/Treasury-Implementation.sol/Treasury-Implementation.json b/scripts/test-contracts/artifacts/contracts/Treasury-Implementation.sol/Treasury-Implementation.json new file mode 100644 index 000000000..63e06e742 --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/Treasury-Implementation.sol/Treasury-Implementation.json @@ -0,0 +1,718 @@ +{ + "address": "0x2D8739f3b808794DC8d4eea5bD683a3CD6f52c05", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "senderBalance", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "recipientBalance", + "type": "uint256" + } + ], + "name": "CancelStream", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "stopTime", + "type": "uint256" + } + ], + "name": "CreateStream", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "fundsAdmin", + "type": "address" + } + ], + "name": "NewFundsAdmin", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "WithdrawFromStream", + "type": "event" + }, + { + "inputs": [], + "name": "ETH_MOCK_ADDRESS", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "REVISION", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "who", + "type": "address" + } + ], + "name": "balanceOf", + "outputs": [ + { + "internalType": "uint256", + "name": "balance", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + } + ], + "name": "cancelStream", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stopTime", + "type": "uint256" + } + ], + "name": "createStream", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + } + ], + "name": "deltaOf", + "outputs": [ + { + "internalType": "uint256", + "name": "delta", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getFundsAdmin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNextStreamId", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + } + ], + "name": "getStream", + "outputs": [ + { + "internalType": "address", + "name": "sender", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "deposit", + "type": "uint256" + }, + { + "internalType": "address", + "name": "tokenAddress", + "type": "address" + }, + { + "internalType": "uint256", + "name": "startTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "stopTime", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "remainingBalance", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "ratePerSecond", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "fundsAdmin", + "type": "address" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "token", + "type": "address" + }, + { + "internalType": "address", + "name": "recipient", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "transfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "streamId", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "withdrawFromStream", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xf1024326203a7a391b9796850be71bb8b32502b3e5aaa492158a0e7968b4d147", + "receipt": { + "to": null, + "from": "0x0deFa256f28402E780671CCf4cb8C867eb0Ec534", + "contractAddress": "0x2D8739f3b808794DC8d4eea5bD683a3CD6f52c05", + "transactionIndex": 0, + "gasUsed": "3569964", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x749f3850f2e0cfcdf52b53b806892a7a0c451e8e759b96f71eab0f333e8f6c12", + "transactionHash": "0xf1024326203a7a391b9796850be71bb8b32502b3e5aaa492158a0e7968b4d147", + "logs": [], + "blockNumber": 2125635, + "cumulativeGasUsed": "3569964", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "f83ccc030186e5b58439131350431de3", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"senderBalance\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"recipientBalance\",\"type\":\"uint256\"}],\"name\":\"CancelStream\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"stopTime\",\"type\":\"uint256\"}],\"name\":\"CreateStream\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"fundsAdmin\",\"type\":\"address\"}],\"name\":\"NewFundsAdmin\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"WithdrawFromStream\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ETH_MOCK_ADDRESS\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REVISION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"who\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"balance\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"}],\"name\":\"cancelStream\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stopTime\",\"type\":\"uint256\"}],\"name\":\"createStream\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"}],\"name\":\"deltaOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"delta\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getFundsAdmin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNextStreamId\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"}],\"name\":\"getStream\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"startTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"stopTime\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"remainingBalance\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ratePerSecond\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"fundsAdmin\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contract IERC20\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"transfer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"streamId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdrawFromStream\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"author\":\"BGD Labs*\",\"kind\":\"dev\",\"methods\":{\"approve(address,address,uint256)\":{\"details\":\"Function for the funds admin to give ERC20 allowance to other parties\",\"params\":{\"amount\":\"Allowance to approve*\",\"recipient\":\"Allowance's recipient\",\"token\":\"The address of the token to give allowance from\"}},\"balanceOf(uint256,address)\":{\"details\":\"Throws if the id does not point to a valid stream.\",\"params\":{\"streamId\":\"The id of the stream for which to query the balance.\",\"who\":\"The address for which to query the balance.\"}},\"cancelStream(uint256)\":{\"details\":\"Throws if the id does not point to a valid stream. Throws if the caller is not the funds admin or the recipient of the stream. Throws if there is a token transfer failure.\",\"params\":{\"streamId\":\"The id of the stream to cancel.\"}},\"createStream(address,uint256,address,uint256,uint256)\":{\"details\":\"Throws if the recipient is the zero address, the contract itself or the caller. Throws if the deposit is 0. Throws if the start time is before `block.timestamp`. Throws if the stop time is before the start time. Throws if the duration calculation has a math error. Throws if the deposit is smaller than the duration. Throws if the deposit is not a multiple of the duration. Throws if the rate calculation has a math error. Throws if the next stream id calculation has a math error. Throws if the contract is not allowed to transfer enough tokens. Throws if there is a token transfer failure.\",\"params\":{\"deposit\":\"The amount of money to be streamed.\",\"recipient\":\"The address towards which the money is streamed.\",\"startTime\":\"The unix timestamp for when the stream starts.\",\"stopTime\":\"The unix timestamp for when the stream stops.\",\"tokenAddress\":\"The ERC20 token to use as streaming currency.\"}},\"deltaOf(uint256)\":{\"details\":\"Throws if the id does not point to a valid stream.\",\"params\":{\"streamId\":\"The id of the stream for which to query the delta.\"}},\"getFundsAdmin()\":{\"returns\":{\"_0\":\"address The address of the funds admin*\"}},\"getStream(uint256)\":{\"details\":\"Throws if the id does not point to a valid stream.\",\"params\":{\"streamId\":\"The id of the stream to query.\"}},\"transfer(address,address,uint256)\":{\"params\":{\"amount\":\"Amount to transfer*\",\"recipient\":\"Transfer's recipient\",\"token\":\"The address of the token to transfer\"}},\"withdrawFromStream(uint256,uint256)\":{\"details\":\"Throws if the id does not point to a valid stream. Throws if the caller is not the funds admin or the recipient of the stream. Throws if the amount exceeds the available balance. Throws if there is a token transfer failure.\",\"params\":{\"amount\":\"The amount of tokens to withdraw.\",\"streamId\":\"The id of the stream to withdraw tokens from.\"}}},\"title\":\"AaveEcosystemReserve v2\",\"version\":1},\"userdoc\":{\"events\":{\"NewFundsAdmin(address)\":{\"notice\":\"Emitted when the funds admin changes\"}},\"kind\":\"user\",\"methods\":{\"ETH_MOCK_ADDRESS()\":{\"notice\":\"Returns the mock ETH reference address\"},\"balanceOf(uint256,address)\":{\"notice\":\"Returns the available funds for the given stream id and address.Returns the total funds allocated to `who` as uint256.\"},\"cancelStream(uint256)\":{\"notice\":\"Cancels the stream and transfers the tokens back on a pro rata basis.Returns bool true=success, otherwise false.\"},\"createStream(address,uint256,address,uint256,uint256)\":{\"notice\":\"Creates a new stream funded by this contracts itself and paid towards `recipient`.Returns the uint256 id of the newly created stream.\"},\"deltaOf(uint256)\":{\"notice\":\"Returns either the delta in seconds between `block.timestamp` and `startTime` or between `stopTime` and `startTime, whichever is smaller. If `block.timestamp` is before `startTime`, it returns 0.Returns the time delta in seconds.\"},\"getFundsAdmin()\":{\"notice\":\"Return the funds admin, only entity to be able to interact with this contract (controller of reserve)\"},\"getNextStreamId()\":{\"notice\":\"Returns the next available stream idReturns the stream id.\"},\"getStream(uint256)\":{\"notice\":\"Returns the stream with all its properties.Returns the stream object.\"},\"transfer(address,address,uint256)\":{\"notice\":\"Function for the funds admin to transfer ERC20 tokens to other parties\"},\"withdrawFromStream(uint256,uint256)\":{\"notice\":\"Withdraws from the contract to the recipient's account.\"}},\"notice\":\"Stores ERC20 tokens of an ecosystem reserve, adding streaming capabilities. Modification of Sablier https://github.com/sablierhq/sablier/blob/develop/packages/protocol/contracts/Sablier.sol Original can be found also deployed on https://etherscan.io/address/0xCD18eAa163733Da39c232722cBC4E8940b1D8888 Modifications: - Sablier \\\"pulls\\\" the funds from the creator of the stream at creation. In the Aave case, we already have the funds. - Anybody can create streams on Sablier. Here, only the funds admin (Aave governance via controller) can - Adapted codebase to Solidity 0.8.11, mainly removing SafeMath and CarefulMath to use native safe math - Same as with creation, on Sablier the `sender` and `recipient` can cancel a stream. Here, only fund admin and recipient\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol\":\"AaveEcosystemReserveV2\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[]},\"sources\":{\"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20 {\\n /**\\n * @dev Returns the amount of tokens in existence.\\n */\\n function totalSupply() external view returns (uint256);\\n\\n /**\\n * @dev Returns the amount of tokens owned by `account`.\\n */\\n function balanceOf(address account) external view returns (uint256);\\n\\n /**\\n * @dev Moves `amount` tokens from the caller's account to `recipient`.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transfer(address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Returns the remaining number of tokens that `spender` will be\\n * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n * zero by default.\\n *\\n * This value changes when {approve} or {transferFrom} are called.\\n */\\n function allowance(address owner, address spender) external view returns (uint256);\\n\\n /**\\n * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n * that someone may use both the old and the new allowance by unfortunate\\n * transaction ordering. One possible solution to mitigate this race\\n * condition is to first reduce the spender's allowance to 0 and set the\\n * desired value afterwards:\\n * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n *\\n * Emits an {Approval} event.\\n */\\n function approve(address spender, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Moves `amount` tokens from `sender` to `recipient` using the\\n * allowance mechanism. `amount` is then deducted from the caller's\\n * allowance.\\n *\\n * Returns a boolean value indicating whether the operation succeeded.\\n *\\n * Emits a {Transfer} event.\\n */\\n function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);\\n\\n /**\\n * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n * another (`to`).\\n *\\n * Note that `value` may be zero.\\n */\\n event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n /**\\n * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n * a call to {approve}. `value` is the new allowance.\\n */\\n event Approval(address indexed owner, address indexed spender, uint256 value);\\n}\\n\",\"keccak256\":\"0xf57d62241e553696a1324d225663ba2e1a51db0a51ca236d0c1b009d89b6284c\",\"license\":\"AGPL-3.0\"},\"@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.10;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\nimport {IStreamable} from './interfaces/IStreamable.sol';\\nimport {AdminControlledEcosystemReserve} from './AdminControlledEcosystemReserve.sol';\\nimport {ReentrancyGuard} from './libs/ReentrancyGuard.sol';\\nimport {SafeERC20} from './libs/SafeERC20.sol';\\n\\n/**\\n * @title AaveEcosystemReserve v2\\n * @notice Stores ERC20 tokens of an ecosystem reserve, adding streaming capabilities.\\n * Modification of Sablier https://github.com/sablierhq/sablier/blob/develop/packages/protocol/contracts/Sablier.sol\\n * Original can be found also deployed on https://etherscan.io/address/0xCD18eAa163733Da39c232722cBC4E8940b1D8888\\n * Modifications:\\n * - Sablier \\\"pulls\\\" the funds from the creator of the stream at creation. In the Aave case, we already have the funds.\\n * - Anybody can create streams on Sablier. Here, only the funds admin (Aave governance via controller) can\\n * - Adapted codebase to Solidity 0.8.11, mainly removing SafeMath and CarefulMath to use native safe math\\n * - Same as with creation, on Sablier the `sender` and `recipient` can cancel a stream. Here, only fund admin and recipient\\n * @author BGD Labs\\n **/\\ncontract AaveEcosystemReserveV2 is AdminControlledEcosystemReserve, ReentrancyGuard, IStreamable {\\n using SafeERC20 for IERC20;\\n\\n /*** Storage Properties ***/\\n\\n /**\\n * @notice Counter for new stream ids.\\n */\\n uint256 private _nextStreamId;\\n\\n /**\\n * @notice The stream objects identifiable by their unsigned integer ids.\\n */\\n mapping(uint256 => Stream) private _streams;\\n\\n /*** Modifiers ***/\\n\\n /**\\n * @dev Throws if the caller is not the funds admin of the recipient of the stream.\\n */\\n modifier onlyAdminOrRecipient(uint256 streamId) {\\n require(\\n msg.sender == _fundsAdmin || msg.sender == _streams[streamId].recipient,\\n 'caller is not the funds admin or the recipient of the stream'\\n );\\n _;\\n }\\n\\n /**\\n * @dev Throws if the provided id does not point to a valid stream.\\n */\\n modifier streamExists(uint256 streamId) {\\n require(_streams[streamId].isEntity, 'stream does not exist');\\n _;\\n }\\n\\n /*** Contract Logic Starts Here */\\n\\n function initialize(address fundsAdmin) external initializer {\\n _nextStreamId = 100000;\\n _setFundsAdmin(fundsAdmin);\\n }\\n\\n /*** View Functions ***/\\n\\n /**\\n * @notice Returns the next available stream id\\n * @notice Returns the stream id.\\n */\\n function getNextStreamId() external view returns (uint256) {\\n return _nextStreamId;\\n }\\n\\n /**\\n * @notice Returns the stream with all its properties.\\n * @dev Throws if the id does not point to a valid stream.\\n * @param streamId The id of the stream to query.\\n * @notice Returns the stream object.\\n */\\n function getStream(\\n uint256 streamId\\n )\\n external\\n view\\n streamExists(streamId)\\n returns (\\n address sender,\\n address recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime,\\n uint256 remainingBalance,\\n uint256 ratePerSecond\\n )\\n {\\n sender = _streams[streamId].sender;\\n recipient = _streams[streamId].recipient;\\n deposit = _streams[streamId].deposit;\\n tokenAddress = _streams[streamId].tokenAddress;\\n startTime = _streams[streamId].startTime;\\n stopTime = _streams[streamId].stopTime;\\n remainingBalance = _streams[streamId].remainingBalance;\\n ratePerSecond = _streams[streamId].ratePerSecond;\\n }\\n\\n /**\\n * @notice Returns either the delta in seconds between `block.timestamp` and `startTime` or\\n * between `stopTime` and `startTime, whichever is smaller. If `block.timestamp` is before\\n * `startTime`, it returns 0.\\n * @dev Throws if the id does not point to a valid stream.\\n * @param streamId The id of the stream for which to query the delta.\\n * @notice Returns the time delta in seconds.\\n */\\n function deltaOf(uint256 streamId) public view streamExists(streamId) returns (uint256 delta) {\\n Stream memory stream = _streams[streamId];\\n if (block.timestamp <= stream.startTime) return 0;\\n if (block.timestamp < stream.stopTime) return block.timestamp - stream.startTime;\\n return stream.stopTime - stream.startTime;\\n }\\n\\n struct BalanceOfLocalVars {\\n uint256 recipientBalance;\\n uint256 withdrawalAmount;\\n uint256 senderBalance;\\n }\\n\\n /**\\n * @notice Returns the available funds for the given stream id and address.\\n * @dev Throws if the id does not point to a valid stream.\\n * @param streamId The id of the stream for which to query the balance.\\n * @param who The address for which to query the balance.\\n * @notice Returns the total funds allocated to `who` as uint256.\\n */\\n function balanceOf(\\n uint256 streamId,\\n address who\\n ) public view streamExists(streamId) returns (uint256 balance) {\\n Stream memory stream = _streams[streamId];\\n BalanceOfLocalVars memory vars;\\n\\n uint256 delta = deltaOf(streamId);\\n vars.recipientBalance = delta * stream.ratePerSecond;\\n\\n /*\\n * If the stream `balance` does not equal `deposit`, it means there have been withdrawals.\\n * We have to subtract the total amount withdrawn from the amount of money that has been\\n * streamed until now.\\n */\\n if (stream.deposit > stream.remainingBalance) {\\n vars.withdrawalAmount = stream.deposit - stream.remainingBalance;\\n vars.recipientBalance = vars.recipientBalance - vars.withdrawalAmount;\\n }\\n\\n if (who == stream.recipient) return vars.recipientBalance;\\n if (who == stream.sender) {\\n vars.senderBalance = stream.remainingBalance - vars.recipientBalance;\\n return vars.senderBalance;\\n }\\n return 0;\\n }\\n\\n /*** Public Effects & Interactions Functions ***/\\n\\n struct CreateStreamLocalVars {\\n uint256 duration;\\n uint256 ratePerSecond;\\n }\\n\\n /**\\n * @notice Creates a new stream funded by this contracts itself and paid towards `recipient`.\\n * @dev Throws if the recipient is the zero address, the contract itself or the caller.\\n * Throws if the deposit is 0.\\n * Throws if the start time is before `block.timestamp`.\\n * Throws if the stop time is before the start time.\\n * Throws if the duration calculation has a math error.\\n * Throws if the deposit is smaller than the duration.\\n * Throws if the deposit is not a multiple of the duration.\\n * Throws if the rate calculation has a math error.\\n * Throws if the next stream id calculation has a math error.\\n * Throws if the contract is not allowed to transfer enough tokens.\\n * Throws if there is a token transfer failure.\\n * @param recipient The address towards which the money is streamed.\\n * @param deposit The amount of money to be streamed.\\n * @param tokenAddress The ERC20 token to use as streaming currency.\\n * @param startTime The unix timestamp for when the stream starts.\\n * @param stopTime The unix timestamp for when the stream stops.\\n * @notice Returns the uint256 id of the newly created stream.\\n */\\n function createStream(\\n address recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n ) external onlyFundsAdmin returns (uint256) {\\n require(recipient != address(0), 'stream to the zero address');\\n require(recipient != address(this), 'stream to the contract itself');\\n require(recipient != msg.sender, 'stream to the caller');\\n require(deposit > 0, 'deposit is zero');\\n require(startTime >= block.timestamp, 'start time before block.timestamp');\\n require(stopTime > startTime, 'stop time before the start time');\\n\\n CreateStreamLocalVars memory vars;\\n vars.duration = stopTime - startTime;\\n\\n /* Without this, the rate per second would be zero. */\\n require(deposit >= vars.duration, 'deposit smaller than time delta');\\n\\n /* This condition avoids dealing with remainders */\\n require(deposit % vars.duration == 0, 'deposit not multiple of time delta');\\n\\n vars.ratePerSecond = deposit / vars.duration;\\n\\n /* Create and store the stream object. */\\n uint256 streamId = _nextStreamId;\\n _streams[streamId] = Stream({\\n remainingBalance: deposit,\\n deposit: deposit,\\n isEntity: true,\\n ratePerSecond: vars.ratePerSecond,\\n recipient: recipient,\\n sender: address(this),\\n startTime: startTime,\\n stopTime: stopTime,\\n tokenAddress: tokenAddress\\n });\\n\\n /* Increment the next stream id. */\\n _nextStreamId++;\\n\\n emit CreateStream(\\n streamId,\\n address(this),\\n recipient,\\n deposit,\\n tokenAddress,\\n startTime,\\n stopTime\\n );\\n return streamId;\\n }\\n\\n /**\\n * @notice Withdraws from the contract to the recipient's account.\\n * @dev Throws if the id does not point to a valid stream.\\n * Throws if the caller is not the funds admin or the recipient of the stream.\\n * Throws if the amount exceeds the available balance.\\n * Throws if there is a token transfer failure.\\n * @param streamId The id of the stream to withdraw tokens from.\\n * @param amount The amount of tokens to withdraw.\\n */\\n function withdrawFromStream(\\n uint256 streamId,\\n uint256 amount\\n ) external nonReentrant streamExists(streamId) onlyAdminOrRecipient(streamId) returns (bool) {\\n require(amount > 0, 'amount is zero');\\n Stream memory stream = _streams[streamId];\\n\\n uint256 balance = balanceOf(streamId, stream.recipient);\\n require(balance >= amount, 'amount exceeds the available balance');\\n\\n _streams[streamId].remainingBalance = stream.remainingBalance - amount;\\n\\n if (_streams[streamId].remainingBalance == 0) delete _streams[streamId];\\n\\n IERC20(stream.tokenAddress).safeTransfer(stream.recipient, amount);\\n emit WithdrawFromStream(streamId, stream.recipient, amount);\\n return true;\\n }\\n\\n /**\\n * @notice Cancels the stream and transfers the tokens back on a pro rata basis.\\n * @dev Throws if the id does not point to a valid stream.\\n * Throws if the caller is not the funds admin or the recipient of the stream.\\n * Throws if there is a token transfer failure.\\n * @param streamId The id of the stream to cancel.\\n * @notice Returns bool true=success, otherwise false.\\n */\\n function cancelStream(\\n uint256 streamId\\n ) external nonReentrant streamExists(streamId) onlyAdminOrRecipient(streamId) returns (bool) {\\n Stream memory stream = _streams[streamId];\\n uint256 senderBalance = balanceOf(streamId, stream.sender);\\n uint256 recipientBalance = balanceOf(streamId, stream.recipient);\\n\\n delete _streams[streamId];\\n\\n IERC20 token = IERC20(stream.tokenAddress);\\n if (recipientBalance > 0) token.safeTransfer(stream.recipient, recipientBalance);\\n\\n emit CancelStream(streamId, stream.sender, stream.recipient, senderBalance, recipientBalance);\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa3bff65c621a97378e69e11074fe71c5eaadb723d1b89672541f9acb34b1706e\",\"license\":\"GPL-3.0\"},\"@aave/periphery-v3/contracts/treasury/AdminControlledEcosystemReserve.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.10;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\nimport {IAdminControlledEcosystemReserve} from './interfaces/IAdminControlledEcosystemReserve.sol';\\nimport {VersionedInitializable} from './libs/VersionedInitializable.sol';\\nimport {SafeERC20} from './libs/SafeERC20.sol';\\nimport {ReentrancyGuard} from './libs/ReentrancyGuard.sol';\\nimport {Address} from './libs/Address.sol';\\n\\n/**\\n * @title AdminControlledEcosystemReserve\\n * @notice Stores ERC20 tokens, and allows to dispose of them via approval or transfer dynamics\\n * Adapted to be an implementation of a transparent proxy\\n * @dev Done abstract to add an `initialize()` function on the child, with `initializer` modifier\\n * @author BGD Labs\\n **/\\nabstract contract AdminControlledEcosystemReserve is\\n VersionedInitializable,\\n IAdminControlledEcosystemReserve\\n{\\n using SafeERC20 for IERC20;\\n using Address for address payable;\\n\\n address internal _fundsAdmin;\\n\\n uint256 public constant REVISION = 1;\\n\\n /// @inheritdoc IAdminControlledEcosystemReserve\\n address public constant ETH_MOCK_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;\\n\\n modifier onlyFundsAdmin() {\\n require(msg.sender == _fundsAdmin, 'ONLY_BY_FUNDS_ADMIN');\\n _;\\n }\\n\\n function getRevision() internal pure override returns (uint256) {\\n return REVISION;\\n }\\n\\n /// @inheritdoc IAdminControlledEcosystemReserve\\n function getFundsAdmin() external view returns (address) {\\n return _fundsAdmin;\\n }\\n\\n /// @inheritdoc IAdminControlledEcosystemReserve\\n function approve(IERC20 token, address recipient, uint256 amount) external onlyFundsAdmin {\\n token.safeApprove(recipient, amount);\\n }\\n\\n /// @inheritdoc IAdminControlledEcosystemReserve\\n function transfer(IERC20 token, address recipient, uint256 amount) external onlyFundsAdmin {\\n require(recipient != address(0), 'INVALID_0X_RECIPIENT');\\n\\n if (address(token) == ETH_MOCK_ADDRESS) {\\n payable(recipient).sendValue(amount);\\n } else {\\n token.safeTransfer(recipient, amount);\\n }\\n }\\n\\n /// @dev needed in order to receive ETH from the Aave v1 ecosystem reserve\\n receive() external payable {}\\n\\n function _setFundsAdmin(address admin) internal {\\n _fundsAdmin = admin;\\n emit NewFundsAdmin(admin);\\n }\\n}\\n\",\"keccak256\":\"0xd2a27f2964946752412b11f2528e6c61b49d79c54576bbab1750f8be2651a8aa\",\"license\":\"GPL-3.0\"},\"@aave/periphery-v3/contracts/treasury/interfaces/IAdminControlledEcosystemReserve.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.10;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\n\\ninterface IAdminControlledEcosystemReserve {\\n /** @notice Emitted when the funds admin changes\\n * @param fundsAdmin The new funds admin\\n **/\\n event NewFundsAdmin(address indexed fundsAdmin);\\n\\n /** @notice Returns the mock ETH reference address\\n * @return address The address\\n **/\\n function ETH_MOCK_ADDRESS() external pure returns (address);\\n\\n /**\\n * @notice Return the funds admin, only entity to be able to interact with this contract (controller of reserve)\\n * @return address The address of the funds admin\\n **/\\n function getFundsAdmin() external view returns (address);\\n\\n /**\\n * @dev Function for the funds admin to give ERC20 allowance to other parties\\n * @param token The address of the token to give allowance from\\n * @param recipient Allowance's recipient\\n * @param amount Allowance to approve\\n **/\\n function approve(IERC20 token, address recipient, uint256 amount) external;\\n\\n /**\\n * @notice Function for the funds admin to transfer ERC20 tokens to other parties\\n * @param token The address of the token to transfer\\n * @param recipient Transfer's recipient\\n * @param amount Amount to transfer\\n **/\\n function transfer(IERC20 token, address recipient, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0xe826cd01ee12902faac76b8ee3f26745f08134a5c7610d111605cae74a5e3268\",\"license\":\"GPL-3.0\"},\"@aave/periphery-v3/contracts/treasury/interfaces/IStreamable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.10;\\n\\ninterface IStreamable {\\n struct Stream {\\n uint256 deposit;\\n uint256 ratePerSecond;\\n uint256 remainingBalance;\\n uint256 startTime;\\n uint256 stopTime;\\n address recipient;\\n address sender;\\n address tokenAddress;\\n bool isEntity;\\n }\\n\\n event CreateStream(\\n uint256 indexed streamId,\\n address indexed sender,\\n address indexed recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n );\\n\\n event WithdrawFromStream(uint256 indexed streamId, address indexed recipient, uint256 amount);\\n\\n event CancelStream(\\n uint256 indexed streamId,\\n address indexed sender,\\n address indexed recipient,\\n uint256 senderBalance,\\n uint256 recipientBalance\\n );\\n\\n function balanceOf(uint256 streamId, address who) external view returns (uint256 balance);\\n\\n function getStream(\\n uint256 streamId\\n )\\n external\\n view\\n returns (\\n address sender,\\n address recipient,\\n uint256 deposit,\\n address token,\\n uint256 startTime,\\n uint256 stopTime,\\n uint256 remainingBalance,\\n uint256 ratePerSecond\\n );\\n\\n function createStream(\\n address recipient,\\n uint256 deposit,\\n address tokenAddress,\\n uint256 startTime,\\n uint256 stopTime\\n ) external returns (uint256 streamId);\\n\\n function withdrawFromStream(uint256 streamId, uint256 funds) external returns (bool);\\n\\n function cancelStream(uint256 streamId) external returns (bool);\\n\\n function initialize(address fundsAdmin) external;\\n}\\n\",\"keccak256\":\"0xe4e14f0dc7e4ffdec867f6b547afa37be968d1f293b57a75ff39eafb09c4d37e\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/libs/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/libs/ReentrancyGuard.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuard {\\n // Booleans are more expensive than uint256 or any type that takes up a full\\n // word because each write operation emits an extra SLOAD to first read the\\n // slot's contents, replace the bits taken up by the boolean, and then write\\n // back. This is the compiler's defense against contract upgrades and\\n // pointer aliasing, and it cannot be disabled.\\n\\n // The values being non-zero value makes deployment a bit more expensive,\\n // but in exchange the refund on every call to nonReentrant will be lower in\\n // amount. Since refunds are capped to a percentage of the total\\n // transaction's gas, it is best to keep them low in cases like this one, to\\n // increase the likelihood of the full refund coming into effect.\\n uint256 private constant _NOT_ENTERED = 1;\\n uint256 private constant _ENTERED = 2;\\n\\n uint256 private _status;\\n\\n constructor() {\\n _status = _NOT_ENTERED;\\n }\\n\\n /**\\n * @dev Prevents a contract from calling itself, directly or indirectly.\\n * Calling a `nonReentrant` function from another `nonReentrant`\\n * function is not supported. It is possible to prevent this from happening\\n * by making the `nonReentrant` function external, and making it call a\\n * `private` function that does the actual work.\\n */\\n modifier nonReentrant() {\\n // On the first call to nonReentrant, _notEntered will be true\\n require(_status != _ENTERED, 'ReentrancyGuard: reentrant call');\\n\\n // Any calls to nonReentrant after this point will fail\\n _status = _ENTERED;\\n\\n _;\\n\\n // By storing the original value once again, a refund is triggered (see\\n // https://eips.ethereum.org/EIPS/eip-2200)\\n _status = _NOT_ENTERED;\\n }\\n}\\n\",\"keccak256\":\"0x23927cd1bf798f64d7aca4ea6e045c497ac4c63cfacafa3c48537bae2f1606e1\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/libs/SafeERC20.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport {IERC20} from '@aave/core-v3/contracts/dependencies/openzeppelin/contracts/IERC20.sol';\\nimport {Address} from './Address.sol';\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20 {\\n using Address for address;\\n\\n function safeTransfer(IERC20 token, address to, uint256 value) internal {\\n _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n }\\n\\n function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {\\n _callOptionalReturn(\\n token,\\n abi.encodeWithSelector(token.transferFrom.selector, from, to, value)\\n );\\n }\\n\\n /**\\n * @dev Deprecated. This function has issues similar to the ones found in\\n * {IERC20-approve}, and its usage is discouraged.\\n *\\n * Whenever possible, use {safeIncreaseAllowance} and\\n * {safeDecreaseAllowance} instead.\\n */\\n function safeApprove(IERC20 token, address spender, uint256 value) internal {\\n // safeApprove should only be called when setting an initial allowance,\\n // or when resetting it to zero. To increase and decrease it, use\\n // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n require(\\n (value == 0) || (token.allowance(address(this), spender) == 0),\\n 'SafeERC20: approve from non-zero to non-zero allowance'\\n );\\n _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n }\\n\\n function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n uint256 newAllowance = token.allowance(address(this), spender) + value;\\n _callOptionalReturn(\\n token,\\n abi.encodeWithSelector(token.approve.selector, spender, newAllowance)\\n );\\n }\\n\\n function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {\\n unchecked {\\n uint256 oldAllowance = token.allowance(address(this), spender);\\n require(oldAllowance >= value, 'SafeERC20: decreased allowance below zero');\\n uint256 newAllowance = oldAllowance - value;\\n _callOptionalReturn(\\n token,\\n abi.encodeWithSelector(token.approve.selector, spender, newAllowance)\\n );\\n }\\n }\\n\\n /**\\n * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n * on the return value: the return value is optional (but if data is returned, it must not be false).\\n * @param token The token targeted by the call.\\n * @param data The call data (encoded using abi.encode or one of its variants).\\n */\\n function _callOptionalReturn(IERC20 token, bytes memory data) private {\\n // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n // the target address contains contract code and also asserts for success in the low-level call.\\n\\n bytes memory returndata = address(token).functionCall(data, 'SafeERC20: low-level call failed');\\n if (returndata.length > 0) {\\n // Return data is optional\\n require(abi.decode(returndata, (bool)), 'SafeERC20: ERC20 operation did not succeed');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4f0634b9e21671a9778d0c95d02f4c77b41d5c50c98a39ac1e42fb839bdb47bd\",\"license\":\"MIT\"},\"@aave/periphery-v3/contracts/treasury/libs/VersionedInitializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.10;\\n\\n/**\\n * @title VersionedInitializable\\n *\\n * @dev Helper contract to support initializer functions. To use it, replace\\n * the constructor with a function that has the `initializer` modifier.\\n * WARNING: Unlike constructors, initializer functions must be manually\\n * invoked. This applies both to deploying an Initializable contract, as well\\n * as extending an Initializable contract via inheritance.\\n * WARNING: When used with inheritance, manual care must be taken to not invoke\\n * a parent initializer twice, or ensure that all initializers are idempotent,\\n * because this is not dealt with automatically as with constructors.\\n *\\n * @author Aave, inspired by the OpenZeppelin Initializable contract\\n */\\nabstract contract VersionedInitializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n uint256 internal lastInitializedRevision = 0;\\n\\n /**\\n * @dev Modifier to use in the initializer function of a contract.\\n */\\n modifier initializer() {\\n uint256 revision = getRevision();\\n require(revision > lastInitializedRevision, 'Contract instance has already been initialized');\\n\\n lastInitializedRevision = revision;\\n\\n _;\\n }\\n\\n /// @dev returns the revision number of the contract.\\n /// Needs to be defined in the inherited class as a constant.\\n function getRevision() internal pure virtual returns (uint256);\\n\\n // Reserved storage space to allow for layout changes in the future.\\n uint256[50] private ______gap;\\n}\\n\",\"keccak256\":\"0x2211858d472a0e26994d6f1fa179cb01fb4e69e3b5e23af4937fa342b784f543\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60806040526000805534801561001457600080fd5b506001603455612536806100296000396000f3fe6080604052600436106100d65760003560e01c8063894e9a0d1161007f578063c4d66de811610059578063c4d66de8146102a4578063cc1b4bf6146102c4578063dde43cba146102e4578063e1f21c67146102f957600080fd5b8063894e9a0d146101ea578063a82ccd4d14610262578063beabacc81461028257600080fd5b806351ee886b116100b057806351ee886b146101725780636db9241b1461019a5780637a9b2c6c146101ca57600080fd5b806306bc2ee0146100e25780630932f92b146101335780633656eec21461015257600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561013f57600080fd5b506035545b60405190815260200161012a565b34801561015e57600080fd5b5061014461016d3660046121fa565b610319565b34801561017e57600080fd5b5061010973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156101a657600080fd5b506101ba6101b536600461222a565b610573565b604051901515815260200161012a565b3480156101d657600080fd5b506101ba6101e5366004612243565b610972565b3480156101f657600080fd5b5061020a61020536600461222a565b610e5c565b6040805173ffffffffffffffffffffffffffffffffffffffff998a1681529789166020890152870195909552959092166060850152608084015260a083015260c082019290925260e08101919091526101000161012a565b34801561026e57600080fd5b5061014461027d36600461222a565b610f5c565b34801561028e57600080fd5b506102a261029d366004612265565b6110f0565b005b3480156102b057600080fd5b506102a26102bf3660046122a6565b611266565b3480156102d057600080fd5b506101446102df3660046122c3565b611313565b3480156102f057600080fd5b50610144600181565b34801561030557600080fd5b506102a2610314366004612265565b611a06565b600082815260366020526040812060070154839074010000000000000000000000000000000000000000900460ff166103b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064015b60405180910390fd5b600084815260366020908152604080832081516101208101835281548152600182015481850152600282015481840152600382015460608083019190915260048301546080830152600583015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006840154811660c084015260079093015492831660e08301527401000000000000000000000000000000000000000090920460ff161515610100820152825191820183528482529281018490529081019290925290600061047e87610f5c565b90508260200151816104909190612344565b82526040830151835111156104c657604083015183516104b09190612381565b6020830181905282516104c39190612381565b82525b8260a0015173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610509575051925061056c9050565b8260c0015173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561056457815160408401516105529190612381565b604090920182905250925061056c9050565b600094505050505b5092915050565b6000600260345414156105e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103aa565b6002603455600082815260366020526040902060070154829074010000000000000000000000000000000000000000900460ff1661067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b603354839073ffffffffffffffffffffffffffffffffffffffff163314806106ca575060008181526036602052604090206005015473ffffffffffffffffffffffffffffffffffffffff1633145b610756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f63616c6c6572206973206e6f74207468652066756e64732061646d696e206f7260448201527f2074686520726563697069656e74206f66207468652073747265616d0000000060648201526084016103aa565b6000848152603660209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006820154811660c0840181905260079092015490811660e084015274010000000000000000000000000000000000000000900460ff16151561010083015290919061080f908790610319565b90506000610821878460a00151610319565b600088815260366020526040812081815560018101829055600281018290556003810182905560048101919091556005810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600682018054909116905560070180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560e084015190915081156108e55760a08401516108e59073ffffffffffffffffffffffffffffffffffffffff83169084611aa8565b8360a0015173ffffffffffffffffffffffffffffffffffffffff168460c0015173ffffffffffffffffffffffffffffffffffffffff16897fca3e6079b726e7728802a0537949e2d1c7762304fa641fb06eb56daf2ba8c6b98686604051610956929190918252602082015260400190565b60405180910390a4600196505050505050506001603455919050565b6000600260345414156109e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103aa565b6002603455600083815260366020526040902060070154839074010000000000000000000000000000000000000000900460ff16610a7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b603354849073ffffffffffffffffffffffffffffffffffffffff16331480610ac9575060008181526036602052604090206005015473ffffffffffffffffffffffffffffffffffffffff1633145b610b55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f63616c6c6572206973206e6f74207468652066756e64732061646d696e206f7260448201527f2074686520726563697069656e74206f66207468652073747265616d0000000060648201526084016103aa565b60008411610bbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f616d6f756e74206973207a65726f00000000000000000000000000000000000060448201526064016103aa565b6000858152603660209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015473ffffffffffffffffffffffffffffffffffffffff90811660a084018190526006830154821660c085015260079092015490811660e084015274010000000000000000000000000000000000000000900460ff161515610100830152909190610c78908890610319565b905085811015610d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f616d6f756e7420657863656564732074686520617661696c61626c652062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016103aa565b858260400151610d199190612381565b6000888152603660205260409020600201819055610dc157600087815260366020526040812081815560018101829055600281018290556003810182905560048101919091556005810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600682018054909116905560070180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690555b610df48260a00151878460e0015173ffffffffffffffffffffffffffffffffffffffff16611aa89092919063ffffffff16565b8160a0015173ffffffffffffffffffffffffffffffffffffffff16877f36c3ab437e6a424ed25dc4bfdeb62706aa06558660fab2dab229d2555adaf89c88604051610e4191815260200190565b60405180910390a36001945050505050600160345592915050565b600080600080600080600080886036600082815260200190815260200160002060070160149054906101000a900460ff16610ef3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b50505060009687525050603660205250506040909220600681015460058201548254600784015460038501546004860154600287015460019097015473ffffffffffffffffffffffffffffffffffffffff9687169a958716995093975091909416949092909190565b600081815260366020526040812060070154829074010000000000000000000000000000000000000000900460ff16610ff1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b6000838152603660209081526040918290208251610120810184528154815260018201549281019290925260028101549282019290925260038201546060820181905260048301546080830152600583015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006840154811660c084015260079093015492831660e08301527401000000000000000000000000000000000000000090920460ff1615156101008201529042116110af5760009250506110ea565b80608001514210156110d25760608101516110ca9042612381565b9250506110ea565b806060015181608001516110e69190612381565b9250505b50919050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff82166111ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f494e56414c49445f30585f524543495049454e5400000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156112455761124073ffffffffffffffffffffffffffffffffffffffff831682611b7c565b505050565b61124073ffffffffffffffffffffffffffffffffffffffff84168383611aa8565b60005460019081116112fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201527f656e20696e697469616c697a656400000000000000000000000000000000000060648201526084016103aa565b6000819055620186a060355561130f82611cd6565b5050565b60335460009073ffffffffffffffffffffffffffffffffffffffff163314611397576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616611414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f73747265616d20746f20746865207a65726f206164647265737300000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616301415611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f73747265616d20746f2074686520636f6e747261637420697473656c6600000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616331415611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73747265616d20746f207468652063616c6c657200000000000000000000000060448201526064016103aa565b6000851161157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6465706f736974206973207a65726f000000000000000000000000000000000060448201526064016103aa565b4283101561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f73746172742074696d65206265666f726520626c6f636b2e74696d657374616d60448201527f700000000000000000000000000000000000000000000000000000000000000060648201526084016103aa565b828211611677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f73746f702074696d65206265666f7265207468652073746172742074696d650060448201526064016103aa565b60408051808201909152600080825260208201526116958484612381565b808252861015611701576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f6465706f73697420736d616c6c6572207468616e2074696d652064656c74610060448201526064016103aa565b805161170d90876123c7565b1561179a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f6465706f736974206e6f74206d756c7469706c65206f662074696d652064656c60448201527f746100000000000000000000000000000000000000000000000000000000000060648201526084016103aa565b80516117a690876123db565b81602001818152505060006035549050604051806101200160405280888152602001836020015181526020018881526020018681526020018581526020018973ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020016001151581525060366000838152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e08201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101008201518160070160146101000a81548160ff02191690831515021790555090505060356000815480929190611990906123ef565b90915550506040805188815273ffffffffffffffffffffffffffffffffffffffff88811660208301529181018790526060810186905290891690309083907f7b01d409597969366dc268d7f957a990d1ca3d3449baf8fb45db67351aecfe789060800160405180910390a4979650505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611a87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b61124073ffffffffffffffffffffffffffffffffffffffff84168383611d45565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526112409084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611ec7565b80471015611be6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103aa565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611c40576040519150601f19603f3d011682016040523d82523d6000602084013e611c45565b606091505b5050905080611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103aa565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f1ab77a654795da4cfe37c33188e862203ade9a5c7f1a9d4957669b3ccbec9e1190600090a250565b801580611de557506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de39190612428565b155b611e71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103aa565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526112409084907f095ea7b30000000000000000000000000000000000000000000000000000000090606401611afa565b6000611f29826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611fd39092919063ffffffff16565b8051909150156112405780806020019051810190611f479190612441565b611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103aa565b6060611fe28484600085611fec565b90505b9392505050565b60608247101561207e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103aa565b73ffffffffffffffffffffffffffffffffffffffff85163b6120fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103aa565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516121259190612493565b60006040518083038185875af1925050503d8060008114612162576040519150601f19603f3d011682016040523d82523d6000602084013e612167565b606091505b5091509150612177828286612182565b979650505050505050565b60608315612191575081611fe5565b8251156121a15782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103aa91906124af565b73ffffffffffffffffffffffffffffffffffffffff811681146121f757600080fd5b50565b6000806040838503121561220d57600080fd5b82359150602083013561221f816121d5565b809150509250929050565b60006020828403121561223c57600080fd5b5035919050565b6000806040838503121561225657600080fd5b50508035926020909101359150565b60008060006060848603121561227a57600080fd5b8335612285816121d5565b92506020840135612295816121d5565b929592945050506040919091013590565b6000602082840312156122b857600080fd5b8135611fe5816121d5565b600080600080600060a086880312156122db57600080fd5b85356122e6816121d5565b94506020860135935060408601356122fd816121d5565b94979396509394606081013594506080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561237c5761237c612315565b500290565b60008282101561239357612393612315565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826123d6576123d6612398565b500690565b6000826123ea576123ea612398565b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561242157612421612315565b5060010190565b60006020828403121561243a57600080fd5b5051919050565b60006020828403121561245357600080fd5b81518015158114611fe557600080fd5b60005b8381101561247e578181015183820152602001612466565b8381111561248d576000848401525b50505050565b600082516124a5818460208701612463565b9190910192915050565b60208152600082518060208401526124ce816040850160208701612463565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212202205885b7d7a951becfcc0dcbf469c5a21607e75efdbb2e37d240e8dc2821c7c64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106100d65760003560e01c8063894e9a0d1161007f578063c4d66de811610059578063c4d66de8146102a4578063cc1b4bf6146102c4578063dde43cba146102e4578063e1f21c67146102f957600080fd5b8063894e9a0d146101ea578063a82ccd4d14610262578063beabacc81461028257600080fd5b806351ee886b116100b057806351ee886b146101725780636db9241b1461019a5780637a9b2c6c146101ca57600080fd5b806306bc2ee0146100e25780630932f92b146101335780633656eec21461015257600080fd5b366100dd57005b600080fd5b3480156100ee57600080fd5b5060335473ffffffffffffffffffffffffffffffffffffffff165b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b34801561013f57600080fd5b506035545b60405190815260200161012a565b34801561015e57600080fd5b5061014461016d3660046121fa565b610319565b34801561017e57600080fd5b5061010973eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b3480156101a657600080fd5b506101ba6101b536600461222a565b610573565b604051901515815260200161012a565b3480156101d657600080fd5b506101ba6101e5366004612243565b610972565b3480156101f657600080fd5b5061020a61020536600461222a565b610e5c565b6040805173ffffffffffffffffffffffffffffffffffffffff998a1681529789166020890152870195909552959092166060850152608084015260a083015260c082019290925260e08101919091526101000161012a565b34801561026e57600080fd5b5061014461027d36600461222a565b610f5c565b34801561028e57600080fd5b506102a261029d366004612265565b6110f0565b005b3480156102b057600080fd5b506102a26102bf3660046122a6565b611266565b3480156102d057600080fd5b506101446102df3660046122c3565b611313565b3480156102f057600080fd5b50610144600181565b34801561030557600080fd5b506102a2610314366004612265565b611a06565b600082815260366020526040812060070154839074010000000000000000000000000000000000000000900460ff166103b3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064015b60405180910390fd5b600084815260366020908152604080832081516101208101835281548152600182015481850152600282015481840152600382015460608083019190915260048301546080830152600583015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006840154811660c084015260079093015492831660e08301527401000000000000000000000000000000000000000090920460ff161515610100820152825191820183528482529281018490529081019290925290600061047e87610f5c565b90508260200151816104909190612344565b82526040830151835111156104c657604083015183516104b09190612381565b6020830181905282516104c39190612381565b82525b8260a0015173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff161415610509575051925061056c9050565b8260c0015173ffffffffffffffffffffffffffffffffffffffff168673ffffffffffffffffffffffffffffffffffffffff16141561056457815160408401516105529190612381565b604090920182905250925061056c9050565b600094505050505b5092915050565b6000600260345414156105e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103aa565b6002603455600082815260366020526040902060070154829074010000000000000000000000000000000000000000900460ff1661067c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b603354839073ffffffffffffffffffffffffffffffffffffffff163314806106ca575060008181526036602052604090206005015473ffffffffffffffffffffffffffffffffffffffff1633145b610756576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f63616c6c6572206973206e6f74207468652066756e64732061646d696e206f7260448201527f2074686520726563697069656e74206f66207468652073747265616d0000000060648201526084016103aa565b6000848152603660209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006820154811660c0840181905260079092015490811660e084015274010000000000000000000000000000000000000000900460ff16151561010083015290919061080f908790610319565b90506000610821878460a00151610319565b600088815260366020526040812081815560018101829055600281018290556003810182905560048101919091556005810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600682018054909116905560070180547fffffffffffffffffffffff00000000000000000000000000000000000000000016905560e084015190915081156108e55760a08401516108e59073ffffffffffffffffffffffffffffffffffffffff83169084611aa8565b8360a0015173ffffffffffffffffffffffffffffffffffffffff168460c0015173ffffffffffffffffffffffffffffffffffffffff16897fca3e6079b726e7728802a0537949e2d1c7762304fa641fb06eb56daf2ba8c6b98686604051610956929190918252602082015260400190565b60405180910390a4600196505050505050506001603455919050565b6000600260345414156109e1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064016103aa565b6002603455600083815260366020526040902060070154839074010000000000000000000000000000000000000000900460ff16610a7b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b603354849073ffffffffffffffffffffffffffffffffffffffff16331480610ac9575060008181526036602052604090206005015473ffffffffffffffffffffffffffffffffffffffff1633145b610b55576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603c60248201527f63616c6c6572206973206e6f74207468652066756e64732061646d696e206f7260448201527f2074686520726563697069656e74206f66207468652073747265616d0000000060648201526084016103aa565b60008411610bbf576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f616d6f756e74206973207a65726f00000000000000000000000000000000000060448201526064016103aa565b6000858152603660209081526040808320815161012081018352815481526001820154938101939093526002810154918301919091526003810154606083015260048101546080830152600581015473ffffffffffffffffffffffffffffffffffffffff90811660a084018190526006830154821660c085015260079092015490811660e084015274010000000000000000000000000000000000000000900460ff161515610100830152909190610c78908890610319565b905085811015610d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152602060048201526024808201527f616d6f756e7420657863656564732074686520617661696c61626c652062616c60448201527f616e63650000000000000000000000000000000000000000000000000000000060648201526084016103aa565b858260400151610d199190612381565b6000888152603660205260409020600201819055610dc157600087815260366020526040812081815560018101829055600281018290556003810182905560048101919091556005810180547fffffffffffffffffffffffff0000000000000000000000000000000000000000908116909155600682018054909116905560070180547fffffffffffffffffffffff0000000000000000000000000000000000000000001690555b610df48260a00151878460e0015173ffffffffffffffffffffffffffffffffffffffff16611aa89092919063ffffffff16565b8160a0015173ffffffffffffffffffffffffffffffffffffffff16877f36c3ab437e6a424ed25dc4bfdeb62706aa06558660fab2dab229d2555adaf89c88604051610e4191815260200190565b60405180910390a36001945050505050600160345592915050565b600080600080600080600080886036600082815260200190815260200160002060070160149054906101000a900460ff16610ef3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b50505060009687525050603660205250506040909220600681015460058201548254600784015460038501546004860154600287015460019097015473ffffffffffffffffffffffffffffffffffffffff9687169a958716995093975091909416949092909190565b600081815260366020526040812060070154829074010000000000000000000000000000000000000000900460ff16610ff1576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601560248201527f73747265616d20646f6573206e6f74206578697374000000000000000000000060448201526064016103aa565b6000838152603660209081526040918290208251610120810184528154815260018201549281019290925260028101549282019290925260038201546060820181905260048301546080830152600583015473ffffffffffffffffffffffffffffffffffffffff90811660a08401526006840154811660c084015260079093015492831660e08301527401000000000000000000000000000000000000000090920460ff1615156101008201529042116110af5760009250506110ea565b80608001514210156110d25760608101516110ca9042612381565b9250506110ea565b806060015181608001516110e69190612381565b9250505b50919050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611171576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff82166111ee576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f494e56414c49445f30585f524543495049454e5400000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff831673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14156112455761124073ffffffffffffffffffffffffffffffffffffffff831682611b7c565b505050565b61124073ffffffffffffffffffffffffffffffffffffffff84168383611aa8565b60005460019081116112fa576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602e60248201527f436f6e747261637420696e7374616e63652068617320616c726561647920626560448201527f656e20696e697469616c697a656400000000000000000000000000000000000060648201526084016103aa565b6000819055620186a060355561130f82611cd6565b5050565b60335460009073ffffffffffffffffffffffffffffffffffffffff163314611397576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616611414576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601a60248201527f73747265616d20746f20746865207a65726f206164647265737300000000000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616301415611494576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f73747265616d20746f2074686520636f6e747261637420697473656c6600000060448201526064016103aa565b73ffffffffffffffffffffffffffffffffffffffff8616331415611514576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f73747265616d20746f207468652063616c6c657200000000000000000000000060448201526064016103aa565b6000851161157e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f6465706f736974206973207a65726f000000000000000000000000000000000060448201526064016103aa565b4283101561160e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602160248201527f73746172742074696d65206265666f726520626c6f636b2e74696d657374616d60448201527f700000000000000000000000000000000000000000000000000000000000000060648201526084016103aa565b828211611677576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f73746f702074696d65206265666f7265207468652073746172742074696d650060448201526064016103aa565b60408051808201909152600080825260208201526116958484612381565b808252861015611701576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601f60248201527f6465706f73697420736d616c6c6572207468616e2074696d652064656c74610060448201526064016103aa565b805161170d90876123c7565b1561179a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602260248201527f6465706f736974206e6f74206d756c7469706c65206f662074696d652064656c60448201527f746100000000000000000000000000000000000000000000000000000000000060648201526084016103aa565b80516117a690876123db565b81602001818152505060006035549050604051806101200160405280888152602001836020015181526020018881526020018681526020018581526020018973ffffffffffffffffffffffffffffffffffffffff1681526020013073ffffffffffffffffffffffffffffffffffffffff1681526020018773ffffffffffffffffffffffffffffffffffffffff1681526020016001151581525060366000838152602001908152602001600020600082015181600001556020820151816001015560408201518160020155606082015181600301556080820151816004015560a08201518160050160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060c08201518160060160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060e08201518160070160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506101008201518160070160146101000a81548160ff02191690831515021790555090505060356000815480929190611990906123ef565b90915550506040805188815273ffffffffffffffffffffffffffffffffffffffff88811660208301529181018790526060810186905290891690309083907f7b01d409597969366dc268d7f957a990d1ca3d3449baf8fb45db67351aecfe789060800160405180910390a4979650505050505050565b60335473ffffffffffffffffffffffffffffffffffffffff163314611a87576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601360248201527f4f4e4c595f42595f46554e44535f41444d494e0000000000000000000000000060448201526064016103aa565b61124073ffffffffffffffffffffffffffffffffffffffff84168383611d45565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526112409084907fa9059cbb00000000000000000000000000000000000000000000000000000000906064015b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fffffffff0000000000000000000000000000000000000000000000000000000090931692909217909152611ec7565b80471015611be6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e636500000060448201526064016103aa565b60008273ffffffffffffffffffffffffffffffffffffffff168260405160006040518083038185875af1925050503d8060008114611c40576040519150601f19603f3d011682016040523d82523d6000602084013e611c45565b606091505b5050905080611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c207260448201527f6563697069656e74206d6179206861766520726576657274656400000000000060648201526084016103aa565b603380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff83169081179091556040517f1ab77a654795da4cfe37c33188e862203ade9a5c7f1a9d4957669b3ccbec9e1190600090a250565b801580611de557506040517fdd62ed3e00000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff838116602483015284169063dd62ed3e90604401602060405180830381865afa158015611dbf573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611de39190612428565b155b611e71576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60448201527f20746f206e6f6e2d7a65726f20616c6c6f77616e63650000000000000000000060648201526084016103aa565b60405173ffffffffffffffffffffffffffffffffffffffff83166024820152604481018290526112409084907f095ea7b30000000000000000000000000000000000000000000000000000000090606401611afa565b6000611f29826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff16611fd39092919063ffffffff16565b8051909150156112405780806020019051810190611f479190612441565b611240576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f7420737563636565640000000000000000000000000000000000000000000060648201526084016103aa565b6060611fe28484600085611fec565b90505b9392505050565b60608247101561207e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c000000000000000000000000000000000000000000000000000060648201526084016103aa565b73ffffffffffffffffffffffffffffffffffffffff85163b6120fc576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016103aa565b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516121259190612493565b60006040518083038185875af1925050503d8060008114612162576040519150601f19603f3d011682016040523d82523d6000602084013e612167565b606091505b5091509150612177828286612182565b979650505050505050565b60608315612191575081611fe5565b8251156121a15782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103aa91906124af565b73ffffffffffffffffffffffffffffffffffffffff811681146121f757600080fd5b50565b6000806040838503121561220d57600080fd5b82359150602083013561221f816121d5565b809150509250929050565b60006020828403121561223c57600080fd5b5035919050565b6000806040838503121561225657600080fd5b50508035926020909101359150565b60008060006060848603121561227a57600080fd5b8335612285816121d5565b92506020840135612295816121d5565b929592945050506040919091013590565b6000602082840312156122b857600080fd5b8135611fe5816121d5565b600080600080600060a086880312156122db57600080fd5b85356122e6816121d5565b94506020860135935060408601356122fd816121d5565b94979396509394606081013594506080013592915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff048311821515161561237c5761237c612315565b500290565b60008282101561239357612393612315565b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000826123d6576123d6612398565b500690565b6000826123ea576123ea612398565b500490565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561242157612421612315565b5060010190565b60006020828403121561243a57600080fd5b5051919050565b60006020828403121561245357600080fd5b81518015158114611fe557600080fd5b60005b8381101561247e578181015183820152602001612466565b8381111561248d576000848401525b50505050565b600082516124a5818460208701612463565b9190910192915050565b60208152600082518060208401526124ce816040850160208701612463565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016919091016040019291505056fea26469706673582212202205885b7d7a951becfcc0dcbf469c5a21607e75efdbb2e37d240e8dc2821c7c64736f6c634300080a0033", + "devdoc": { + "author": "BGD Labs*", + "kind": "dev", + "methods": { + "approve(address,address,uint256)": { + "details": "Function for the funds admin to give ERC20 allowance to other parties", + "params": { + "amount": "Allowance to approve*", + "recipient": "Allowance's recipient", + "token": "The address of the token to give allowance from" + } + }, + "balanceOf(uint256,address)": { + "details": "Throws if the id does not point to a valid stream.", + "params": { + "streamId": "The id of the stream for which to query the balance.", + "who": "The address for which to query the balance." + } + }, + "cancelStream(uint256)": { + "details": "Throws if the id does not point to a valid stream. Throws if the caller is not the funds admin or the recipient of the stream. Throws if there is a token transfer failure.", + "params": { + "streamId": "The id of the stream to cancel." + } + }, + "createStream(address,uint256,address,uint256,uint256)": { + "details": "Throws if the recipient is the zero address, the contract itself or the caller. Throws if the deposit is 0. Throws if the start time is before `block.timestamp`. Throws if the stop time is before the start time. Throws if the duration calculation has a math error. Throws if the deposit is smaller than the duration. Throws if the deposit is not a multiple of the duration. Throws if the rate calculation has a math error. Throws if the next stream id calculation has a math error. Throws if the contract is not allowed to transfer enough tokens. Throws if there is a token transfer failure.", + "params": { + "deposit": "The amount of money to be streamed.", + "recipient": "The address towards which the money is streamed.", + "startTime": "The unix timestamp for when the stream starts.", + "stopTime": "The unix timestamp for when the stream stops.", + "tokenAddress": "The ERC20 token to use as streaming currency." + } + }, + "deltaOf(uint256)": { + "details": "Throws if the id does not point to a valid stream.", + "params": { + "streamId": "The id of the stream for which to query the delta." + } + }, + "getFundsAdmin()": { + "returns": { + "_0": "address The address of the funds admin*" + } + }, + "getStream(uint256)": { + "details": "Throws if the id does not point to a valid stream.", + "params": { + "streamId": "The id of the stream to query." + } + }, + "transfer(address,address,uint256)": { + "params": { + "amount": "Amount to transfer*", + "recipient": "Transfer's recipient", + "token": "The address of the token to transfer" + } + }, + "withdrawFromStream(uint256,uint256)": { + "details": "Throws if the id does not point to a valid stream. Throws if the caller is not the funds admin or the recipient of the stream. Throws if the amount exceeds the available balance. Throws if there is a token transfer failure.", + "params": { + "amount": "The amount of tokens to withdraw.", + "streamId": "The id of the stream to withdraw tokens from." + } + } + }, + "title": "AaveEcosystemReserve v2", + "version": 1 + }, + "userdoc": { + "events": { + "NewFundsAdmin(address)": { + "notice": "Emitted when the funds admin changes" + } + }, + "kind": "user", + "methods": { + "ETH_MOCK_ADDRESS()": { + "notice": "Returns the mock ETH reference address" + }, + "balanceOf(uint256,address)": { + "notice": "Returns the available funds for the given stream id and address.Returns the total funds allocated to `who` as uint256." + }, + "cancelStream(uint256)": { + "notice": "Cancels the stream and transfers the tokens back on a pro rata basis.Returns bool true=success, otherwise false." + }, + "createStream(address,uint256,address,uint256,uint256)": { + "notice": "Creates a new stream funded by this contracts itself and paid towards `recipient`.Returns the uint256 id of the newly created stream." + }, + "deltaOf(uint256)": { + "notice": "Returns either the delta in seconds between `block.timestamp` and `startTime` or between `stopTime` and `startTime, whichever is smaller. If `block.timestamp` is before `startTime`, it returns 0.Returns the time delta in seconds." + }, + "getFundsAdmin()": { + "notice": "Return the funds admin, only entity to be able to interact with this contract (controller of reserve)" + }, + "getNextStreamId()": { + "notice": "Returns the next available stream idReturns the stream id." + }, + "getStream(uint256)": { + "notice": "Returns the stream with all its properties.Returns the stream object." + }, + "transfer(address,address,uint256)": { + "notice": "Function for the funds admin to transfer ERC20 tokens to other parties" + }, + "withdrawFromStream(uint256,uint256)": { + "notice": "Withdraws from the contract to the recipient's account." + } + }, + "notice": "Stores ERC20 tokens of an ecosystem reserve, adding streaming capabilities. Modification of Sablier https://github.com/sablierhq/sablier/blob/develop/packages/protocol/contracts/Sablier.sol Original can be found also deployed on https://etherscan.io/address/0xCD18eAa163733Da39c232722cBC4E8940b1D8888 Modifications: - Sablier \"pulls\" the funds from the creator of the stream at creation. In the Aave case, we already have the funds. - Anybody can create streams on Sablier. Here, only the funds admin (Aave governance via controller) can - Adapted codebase to Solidity 0.8.11, mainly removing SafeMath and CarefulMath to use native safe math - Same as with creation, on Sablier the `sender` and `recipient` can cancel a stream. Here, only fund admin and recipient", + "version": 1 + }, + "storageLayout": { + "storage": [ + { + "astId": 42865, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "lastInitializedRevision", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 42896, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "______gap", + "offset": 0, + "slot": "1", + "type": "t_array(t_uint256)50_storage" + }, + { + "astId": 41673, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "_fundsAdmin", + "offset": 0, + "slot": "51", + "type": "t_address" + }, + { + "astId": 42603, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "_status", + "offset": 0, + "slot": "52", + "type": "t_uint256" + }, + { + "astId": 41024, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "_nextStreamId", + "offset": 0, + "slot": "53", + "type": "t_uint256" + }, + { + "astId": 41030, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "_streams", + "offset": 0, + "slot": "54", + "type": "t_mapping(t_uint256,t_struct(Stream)42194_storage)" + } + ], + "types": { + "t_address": { + "encoding": "inplace", + "label": "address", + "numberOfBytes": "20" + }, + "t_array(t_uint256)50_storage": { + "base": "t_uint256", + "encoding": "inplace", + "label": "uint256[50]", + "numberOfBytes": "1600" + }, + "t_bool": { + "encoding": "inplace", + "label": "bool", + "numberOfBytes": "1" + }, + "t_mapping(t_uint256,t_struct(Stream)42194_storage)": { + "encoding": "mapping", + "key": "t_uint256", + "label": "mapping(uint256 => struct IStreamable.Stream)", + "numberOfBytes": "32", + "value": "t_struct(Stream)42194_storage" + }, + "t_struct(Stream)42194_storage": { + "encoding": "inplace", + "label": "struct IStreamable.Stream", + "members": [ + { + "astId": 42177, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "deposit", + "offset": 0, + "slot": "0", + "type": "t_uint256" + }, + { + "astId": 42179, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "ratePerSecond", + "offset": 0, + "slot": "1", + "type": "t_uint256" + }, + { + "astId": 42181, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "remainingBalance", + "offset": 0, + "slot": "2", + "type": "t_uint256" + }, + { + "astId": 42183, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "startTime", + "offset": 0, + "slot": "3", + "type": "t_uint256" + }, + { + "astId": 42185, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "stopTime", + "offset": 0, + "slot": "4", + "type": "t_uint256" + }, + { + "astId": 42187, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "recipient", + "offset": 0, + "slot": "5", + "type": "t_address" + }, + { + "astId": 42189, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "sender", + "offset": 0, + "slot": "6", + "type": "t_address" + }, + { + "astId": 42191, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "tokenAddress", + "offset": 0, + "slot": "7", + "type": "t_address" + }, + { + "astId": 42193, + "contract": "@aave/periphery-v3/contracts/treasury/AaveEcosystemReserveV2.sol:AaveEcosystemReserveV2", + "label": "isEntity", + "offset": 20, + "slot": "7", + "type": "t_bool" + } + ], + "numberOfBytes": "256" + }, + "t_uint256": { + "encoding": "inplace", + "label": "uint256", + "numberOfBytes": "32" + } + } + } +} \ No newline at end of file diff --git a/scripts/test-contracts/artifacts/contracts/TreasuryProxy.sol/TreasuryProxy.json b/scripts/test-contracts/artifacts/contracts/TreasuryProxy.sol/TreasuryProxy.json new file mode 100644 index 000000000..e6941e67d --- /dev/null +++ b/scripts/test-contracts/artifacts/contracts/TreasuryProxy.sol/TreasuryProxy.json @@ -0,0 +1,238 @@ +{ + "address": "0xAc527d557484E75D4Ef99798E5875085F0923477", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + } + ], + "transactionHash": "0x34cee34243d2f3f62d71f19146903ce356a54200c18417b92608d8ad45c9ee9c", + "receipt": { + "to": null, + "from": "0x0deFa256f28402E780671CCf4cb8C867eb0Ec534", + "contractAddress": "0xAc527d557484E75D4Ef99798E5875085F0923477", + "transactionIndex": 0, + "gasUsed": "1239276", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0x6c7f720a20f2fcf2fb4bac8bf16ba4ec2bc09a3ff129fa04872d9295a217215d", + "transactionHash": "0x34cee34243d2f3f62d71f19146903ce356a54200c18417b92608d8ad45c9ee9c", + "logs": [], + "blockNumber": 2125633, + "cumulativeGasUsed": "1239276", + "status": 1, + "byzantium": true + }, + "args": [], + "numDeployments": 1, + "solcInputHash": "f83ccc030186e5b58439131350431de3", + "metadata": "{\"compiler\":{\"version\":\"0.8.10+commit.fc410830\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"Extends from BaseAdminUpgradeabilityProxy with an initializer for initializing the implementation, admin, and init data.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"returns\":{\"_0\":\"The address of the proxy admin.\"}},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Only the current admin can call this function.\",\"params\":{\"newAdmin\":\"Address to transfer proxy administration to.\"}},\"implementation()\":{\"returns\":{\"_0\":\"The address of the implementation.\"}},\"initialize(address,address,bytes)\":{\"params\":{\"admin\":\"Address of the proxy administrator.\",\"data\":\"Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\",\"logic\":\"address of the initial implementation.\"}},\"initialize(address,bytes)\":{\"details\":\"Contract initializer.\",\"params\":{\"_data\":\"Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\",\"_logic\":\"Address of the initial implementation.\"}},\"upgradeTo(address)\":{\"details\":\"Upgrade the backing implementation of the proxy. Only the admin can call this function.\",\"params\":{\"newImplementation\":\"Address of the new implementation.\"}},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.\",\"params\":{\"data\":\"Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\",\"newImplementation\":\"Address of the new implementation.\"}}},\"title\":\"InitializableAdminUpgradeabilityProxy\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,address,bytes)\":{\"notice\":\"Contract initializer.\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol\":\"InitializableAdminUpgradeabilityProxy\"},\"evmVersion\":\"berlin\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":100000},\"remappings\":[]},\"sources\":{\"@aave/core-v3/contracts/dependencies/openzeppelin/contracts/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Address.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize, which returns 0 for contracts in\\n // construction, since the code is only stored at the end of the\\n // constructor execution.\\n\\n uint256 size;\\n assembly {\\n size := extcodesize(account)\\n }\\n return size > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x4ce20476966f73ba3c0aeb85b602b6ecc4e715f5bd9524d1c6286819282c76c5\",\"license\":\"MIT\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/BaseAdminUpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\nimport './UpgradeabilityProxy.sol';\\n\\n/**\\n * @title BaseAdminUpgradeabilityProxy\\n * @dev This contract combines an upgradeability proxy with an authorization\\n * mechanism for administrative tasks.\\n * All external functions in this contract must be guarded by the\\n * `ifAdmin` modifier. See ethereum/solidity#3864 for a Solidity\\n * feature proposal that would enable this to be done automatically.\\n */\\ncontract BaseAdminUpgradeabilityProxy is BaseUpgradeabilityProxy {\\n /**\\n * @dev Emitted when the administration has been transferred.\\n * @param previousAdmin Address of the previous admin.\\n * @param newAdmin Address of the new admin.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant ADMIN_SLOT =\\n 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Modifier to check whether the `msg.sender` is the admin.\\n * If it is, it will run the function. Otherwise, it will delegate the call\\n * to the implementation.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _admin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @return The address of the proxy admin.\\n */\\n function admin() external ifAdmin returns (address) {\\n return _admin();\\n }\\n\\n /**\\n * @return The address of the implementation.\\n */\\n function implementation() external ifAdmin returns (address) {\\n return _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n * Only the current admin can call this function.\\n * @param newAdmin Address to transfer proxy administration to.\\n */\\n function changeAdmin(address newAdmin) external ifAdmin {\\n require(newAdmin != address(0), 'Cannot change the admin of a proxy to the zero address');\\n emit AdminChanged(_admin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the backing implementation of the proxy.\\n * Only the admin can call this function.\\n * @param newImplementation Address of the new implementation.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeTo(newImplementation);\\n }\\n\\n /**\\n * @dev Upgrade the backing implementation of the proxy and call a function\\n * on the new implementation.\\n * This is useful to initialize the proxied contract.\\n * @param newImplementation Address of the new implementation.\\n * @param data Data to send as msg.data in the low level call.\\n * It should include the signature and the parameters of the function to be called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeTo(newImplementation);\\n (bool success, ) = newImplementation.delegatecall(data);\\n require(success);\\n }\\n\\n /**\\n * @return adm The admin slot.\\n */\\n function _admin() internal view returns (address adm) {\\n bytes32 slot = ADMIN_SLOT;\\n //solium-disable-next-line\\n assembly {\\n adm := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Sets the address of the proxy admin.\\n * @param newAdmin Address of the new proxy admin.\\n */\\n function _setAdmin(address newAdmin) internal {\\n bytes32 slot = ADMIN_SLOT;\\n //solium-disable-next-line\\n assembly {\\n sstore(slot, newAdmin)\\n }\\n }\\n\\n /**\\n * @dev Only fall back when the sender is not the admin.\\n */\\n function _willFallback() internal virtual override {\\n require(msg.sender != _admin(), 'Cannot call fallback function from the proxy admin');\\n super._willFallback();\\n }\\n}\\n\",\"keccak256\":\"0xad78efab85afdf5c383699fca5fd3013451d27a77911c6c2317ae688d32de3bc\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/BaseUpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\nimport './Proxy.sol';\\nimport '../contracts/Address.sol';\\n\\n/**\\n * @title BaseUpgradeabilityProxy\\n * @dev This contract implements a proxy that allows to change the\\n * implementation address to which it will delegate.\\n * Such a change is called an implementation upgrade.\\n */\\ncontract BaseUpgradeabilityProxy is Proxy {\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n * @param implementation Address of the new implementation.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant IMPLEMENTATION_SLOT =\\n 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Returns the current implementation.\\n * @return impl Address of the current implementation\\n */\\n function _implementation() internal view override returns (address impl) {\\n bytes32 slot = IMPLEMENTATION_SLOT;\\n //solium-disable-next-line\\n assembly {\\n impl := sload(slot)\\n }\\n }\\n\\n /**\\n * @dev Upgrades the proxy to a new implementation.\\n * @param newImplementation Address of the new implementation.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Sets the implementation address of the proxy.\\n * @param newImplementation Address of the new implementation.\\n */\\n function _setImplementation(address newImplementation) internal {\\n require(\\n Address.isContract(newImplementation),\\n 'Cannot set a proxy implementation to a non-contract address'\\n );\\n\\n bytes32 slot = IMPLEMENTATION_SLOT;\\n\\n //solium-disable-next-line\\n assembly {\\n sstore(slot, newImplementation)\\n }\\n }\\n}\\n\",\"keccak256\":\"0xe47eb278267d31f096fc643c2a322c72066abfa6ba07f6386c266fe7cbd15013\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableAdminUpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\nimport './BaseAdminUpgradeabilityProxy.sol';\\nimport './InitializableUpgradeabilityProxy.sol';\\n\\n/**\\n * @title InitializableAdminUpgradeabilityProxy\\n * @dev Extends from BaseAdminUpgradeabilityProxy with an initializer for\\n * initializing the implementation, admin, and init data.\\n */\\ncontract InitializableAdminUpgradeabilityProxy is\\n BaseAdminUpgradeabilityProxy,\\n InitializableUpgradeabilityProxy\\n{\\n /**\\n * Contract initializer.\\n * @param logic address of the initial implementation.\\n * @param admin Address of the proxy administrator.\\n * @param data Data to send as msg.data to the implementation to initialize the proxied contract.\\n * It should include the signature and the parameters of the function to be called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\\n */\\n function initialize(address logic, address admin, bytes memory data) public payable {\\n require(_implementation() == address(0));\\n InitializableUpgradeabilityProxy.initialize(logic, data);\\n assert(ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _setAdmin(admin);\\n }\\n\\n /**\\n * @dev Only fall back when the sender is not the admin.\\n */\\n function _willFallback() internal override(BaseAdminUpgradeabilityProxy, Proxy) {\\n BaseAdminUpgradeabilityProxy._willFallback();\\n }\\n}\\n\",\"keccak256\":\"0x8ee2967a5cf8f802fd20b194a45c271597f02df4dab5d9ddaa1642dd4822ad1d\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/InitializableUpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\nimport './BaseUpgradeabilityProxy.sol';\\n\\n/**\\n * @title InitializableUpgradeabilityProxy\\n * @dev Extends BaseUpgradeabilityProxy with an initializer for initializing\\n * implementation and init data.\\n */\\ncontract InitializableUpgradeabilityProxy is BaseUpgradeabilityProxy {\\n /**\\n * @dev Contract initializer.\\n * @param _logic Address of the initial implementation.\\n * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.\\n * It should include the signature and the parameters of the function to be called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\\n */\\n function initialize(address _logic, bytes memory _data) public payable {\\n require(_implementation() == address(0));\\n assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));\\n _setImplementation(_logic);\\n if (_data.length > 0) {\\n (bool success, ) = _logic.delegatecall(_data);\\n require(success);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8a1e927b97f5da20f4640ba4d2588666910dfa89f5a2b0a37440d27e5a47ee08\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\n/**\\n * @title Proxy\\n * @dev Implements delegation of calls to other contracts, with proper\\n * forwarding of return values and bubbling of failures.\\n * It defines a fallback function that delegates all calls to the address\\n * returned by the abstract _implementation() internal function.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Fallback function.\\n * Will run if no other function in the contract matches the call data.\\n * Implemented entirely in `_fallback`.\\n */\\n fallback() external payable {\\n _fallback();\\n }\\n\\n /**\\n * @return The Address of the implementation.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates execution to an implementation contract.\\n * This is a low level function that doesn't return to its internal call site.\\n * It will return to the external caller whatever the implementation returns.\\n * @param implementation Address to delegate.\\n */\\n function _delegate(address implementation) internal {\\n //solium-disable-next-line\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev Function that is run as the first thing in the fallback function.\\n * Can be redefined in derived contracts to add functionality.\\n * Redefinitions must call super._willFallback().\\n */\\n function _willFallback() internal virtual {}\\n\\n /**\\n * @dev fallback implementation.\\n * Extracted to enable manual triggering.\\n */\\n function _fallback() internal {\\n _willFallback();\\n _delegate(_implementation());\\n }\\n}\\n\",\"keccak256\":\"0x7b643f46118c949c65385044807890d836dedfb8cd8417a07a4036325130d8e6\",\"license\":\"AGPL-3.0\"},\"@aave/core-v3/contracts/dependencies/openzeppelin/upgradeability/UpgradeabilityProxy.sol\":{\"content\":\"// SPDX-License-Identifier: AGPL-3.0\\npragma solidity ^0.8.0;\\n\\nimport './BaseUpgradeabilityProxy.sol';\\n\\n/**\\n * @title UpgradeabilityProxy\\n * @dev Extends BaseUpgradeabilityProxy with a constructor for initializing\\n * implementation and init data.\\n */\\ncontract UpgradeabilityProxy is BaseUpgradeabilityProxy {\\n /**\\n * @dev Contract constructor.\\n * @param _logic Address of the initial implementation.\\n * @param _data Data to send as msg.data to the implementation to initialize the proxied contract.\\n * It should include the signature and the parameters of the function to be called, as described in\\n * https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.\\n * This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(IMPLEMENTATION_SLOT == bytes32(uint256(keccak256('eip1967.proxy.implementation')) - 1));\\n _setImplementation(_logic);\\n if (_data.length > 0) {\\n (bool success, ) = _logic.delegatecall(_data);\\n require(success);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa19d50b90ce153fb36d266c926e09db8dc8f110bdda1ae4b4cf2ecd02c26b81c\",\"license\":\"AGPL-3.0\"}},\"version\":1}", + "bytecode": "0x608060405234801561001057600080fd5b50610cca806100206000396000f3fe6080604052600436106100705760003560e01c80638f2839701161004e5780638f283970146100eb578063cf7a1d771461010b578063d1f578941461011e578063f851a4401461013157610070565b80633659cfe61461007a5780634f1ef2861461009a5780635c60da1b146100ad575b610078610146565b005b34801561008657600080fd5b506100786100953660046109b1565b610180565b6100786100a83660046109d3565b6101e9565b3480156100b957600080fd5b506100c26102d1565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f757600080fd5b506100786101063660046109b1565b61035f565b610078610119366004610b30565b6104fc565b61007861012c366004610b8e565b6105d1565b34801561013d57600080fd5b506100c26106fd565b61014e610780565b61017e6101797f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b610788565b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101e1576101de816107ac565b50565b6101de610146565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c457610247836107ac565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051610270929190610bdc565b600060405180830381855af49150503d80600081146102ab576040519150601f19603f3d011682016040523d82523d6000602084013e6102b0565b606091505b50509050806102be57600080fd5b50505050565b6102cc610146565b505050565b60006102fb7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035457507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61035c610146565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101e15773ffffffffffffffffffffffffffffffffffffffff811661045c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f60448201527f787920746f20746865207a65726f20616464726573730000000000000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104a57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a16101de817fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006105267f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b73ffffffffffffffffffffffffffffffffffffffff161461054657600080fd5b61055083826105d1565b61057b60017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104610bec565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103146105a9576105a9610c2a565b6102cc827fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006105fb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b73ffffffffffffffffffffffffffffffffffffffff161461061b57600080fd5b61064660017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610bec565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc1461067457610674610c2a565b61067d826107f9565b8051156106f95760008273ffffffffffffffffffffffffffffffffffffffff16826040516106ab9190610c59565b600060405180830381855af49150503d80600081146106e6576040519150601f19603f3d011682016040523d82523d6000602084013e6106eb565b606091505b50509050806102cc57600080fd5b5050565b60006107277fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035457507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61017e6108ab565b3660008037600080366000845af43d6000803e8080156107a7573d6000f35b3d6000fd5b6107b5816107f9565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e7472616374206164647265737300000000006064820152608401610453565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561017e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667260448201527f6f6d207468652070726f78792061646d696e00000000000000000000000000006064820152608401610453565b803573ffffffffffffffffffffffffffffffffffffffff811681146109ac57600080fd5b919050565b6000602082840312156109c357600080fd5b6109cc82610988565b9392505050565b6000806000604084860312156109e857600080fd5b6109f184610988565b9250602084013567ffffffffffffffff80821115610a0e57600080fd5b818601915086601f830112610a2257600080fd5b813581811115610a3157600080fd5b876020828501011115610a4357600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610a9657600080fd5b813567ffffffffffffffff80821115610ab157610ab1610a56565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610af757610af7610a56565b81604052838152866020858801011115610b1057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610b4557600080fd5b610b4e84610988565b9250610b5c60208501610988565b9150604084013567ffffffffffffffff811115610b7857600080fd5b610b8486828701610a85565b9150509250925092565b60008060408385031215610ba157600080fd5b610baa83610988565b9150602083013567ffffffffffffffff811115610bc657600080fd5b610bd285828601610a85565b9150509250929050565b8183823760009101908152919050565b600082821015610c25577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6000825160005b81811015610c7a5760208186018101518583015201610c60565b81811115610c89576000828501525b50919091019291505056fea2646970667358221220898b8eff1b51b67c005d99015c80fcc765c36a56be64efdd5dbf240b36650f1b64736f6c634300080a0033", + "deployedBytecode": "0x6080604052600436106100705760003560e01c80638f2839701161004e5780638f283970146100eb578063cf7a1d771461010b578063d1f578941461011e578063f851a4401461013157610070565b80633659cfe61461007a5780634f1ef2861461009a5780635c60da1b146100ad575b610078610146565b005b34801561008657600080fd5b506100786100953660046109b1565b610180565b6100786100a83660046109d3565b6101e9565b3480156100b957600080fd5b506100c26102d1565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b3480156100f757600080fd5b506100786101063660046109b1565b61035f565b610078610119366004610b30565b6104fc565b61007861012c366004610b8e565b6105d1565b34801561013d57600080fd5b506100c26106fd565b61014e610780565b61017e6101797f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b610788565b565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101e1576101de816107ac565b50565b6101de610146565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156102c457610247836107ac565b60008373ffffffffffffffffffffffffffffffffffffffff168383604051610270929190610bdc565b600060405180830381855af49150503d80600081146102ab576040519150601f19603f3d011682016040523d82523d6000602084013e6102b0565b606091505b50509050806102be57600080fd5b50505050565b6102cc610146565b505050565b60006102fb7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035457507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b61035c610146565b90565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614156101e15773ffffffffffffffffffffffffffffffffffffffff811661045c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603660248201527f43616e6e6f74206368616e6765207468652061646d696e206f6620612070726f60448201527f787920746f20746865207a65726f20616464726573730000000000000000000060648201526084015b60405180910390fd5b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6104a57fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b6040805173ffffffffffffffffffffffffffffffffffffffff928316815291841660208301520160405180910390a16101de817fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006105267f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b73ffffffffffffffffffffffffffffffffffffffff161461054657600080fd5b61055083826105d1565b61057b60017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104610bec565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103146105a9576105a9610c2a565b6102cc827fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d610355565b60006105fb7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b73ffffffffffffffffffffffffffffffffffffffff161461061b57600080fd5b61064660017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd610bec565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc1461067457610674610c2a565b61067d826107f9565b8051156106f95760008273ffffffffffffffffffffffffffffffffffffffff16826040516106ab9190610c59565b600060405180830381855af49150503d80600081146106e6576040519150601f19603f3d011682016040523d82523d6000602084013e6106eb565b606091505b50509050806102cc57600080fd5b5050565b60006107277fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b73ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561035457507fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035490565b61017e6108ab565b3660008037600080366000845af43d6000803e8080156107a7573d6000f35b3d6000fd5b6107b5816107f9565b60405173ffffffffffffffffffffffffffffffffffffffff8216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b803b610887576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603b60248201527f43616e6e6f742073657420612070726f787920696d706c656d656e746174696f60448201527f6e20746f2061206e6f6e2d636f6e7472616374206164647265737300000000006064820152608401610453565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc55565b7fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16141561017e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152603260248201527f43616e6e6f742063616c6c2066616c6c6261636b2066756e6374696f6e20667260448201527f6f6d207468652070726f78792061646d696e00000000000000000000000000006064820152608401610453565b803573ffffffffffffffffffffffffffffffffffffffff811681146109ac57600080fd5b919050565b6000602082840312156109c357600080fd5b6109cc82610988565b9392505050565b6000806000604084860312156109e857600080fd5b6109f184610988565b9250602084013567ffffffffffffffff80821115610a0e57600080fd5b818601915086601f830112610a2257600080fd5b813581811115610a3157600080fd5b876020828501011115610a4357600080fd5b6020830194508093505050509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b600082601f830112610a9657600080fd5b813567ffffffffffffffff80821115610ab157610ab1610a56565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f01168101908282118183101715610af757610af7610a56565b81604052838152866020858801011115610b1057600080fd5b836020870160208301376000602085830101528094505050505092915050565b600080600060608486031215610b4557600080fd5b610b4e84610988565b9250610b5c60208501610988565b9150604084013567ffffffffffffffff811115610b7857600080fd5b610b8486828701610a85565b9150509250925092565b60008060408385031215610ba157600080fd5b610baa83610988565b9150602083013567ffffffffffffffff811115610bc657600080fd5b610bd285828601610a85565b9150509250929050565b8183823760009101908152919050565b600082821015610c25577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b500390565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052600160045260246000fd5b6000825160005b81811015610c7a5760208186018101518583015201610c60565b81811115610c89576000828501525b50919091019291505056fea2646970667358221220898b8eff1b51b67c005d99015c80fcc765c36a56be64efdd5dbf240b36650f1b64736f6c634300080a0033", + "devdoc": { + "details": "Extends from BaseAdminUpgradeabilityProxy with an initializer for initializing the implementation, admin, and init data.", + "kind": "dev", + "methods": { + "admin()": { + "returns": { + "_0": "The address of the proxy admin." + } + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Only the current admin can call this function.", + "params": { + "newAdmin": "Address to transfer proxy administration to." + } + }, + "implementation()": { + "returns": { + "_0": "The address of the implementation." + } + }, + "initialize(address,address,bytes)": { + "params": { + "admin": "Address of the proxy administrator.", + "data": "Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.", + "logic": "address of the initial implementation." + } + }, + "initialize(address,bytes)": { + "details": "Contract initializer.", + "params": { + "_data": "Data to send as msg.data to the implementation to initialize the proxied contract. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding. This parameter is optional, if no data is given the initialization call to proxied contract will be skipped.", + "_logic": "Address of the initial implementation." + } + }, + "upgradeTo(address)": { + "details": "Upgrade the backing implementation of the proxy. Only the admin can call this function.", + "params": { + "newImplementation": "Address of the new implementation." + } + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.", + "params": { + "data": "Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/v0.4.24/abi-spec.html#function-selector-and-argument-encoding.", + "newImplementation": "Address of the new implementation." + } + } + }, + "title": "InitializableAdminUpgradeabilityProxy", + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": { + "initialize(address,address,bytes)": { + "notice": "Contract initializer." + } + }, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file From 157a08754b391451df1becee01adf8a3b95bc30d Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 30 Sep 2024 13:56:21 +0200 Subject: [PATCH 50/57] resolved warnings --- integration-tests/src/contracts.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index 7a58cc054..b110455d9 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -142,7 +142,6 @@ fn contract_check_should_succeed_when_called_from_extrinsic() { WETH, (10_000_000 * UNITS) as i128, )); - /// For reference with code set in storage this always succeeds pallet_evm::AccountCodes::::insert( dai_ethereum_address(), &hex!["365f5f375f5f365f73bebebebebebebebebebebebebebebebebebebebe5af43d5f5f3e5f3d91602a57fd5bf3"][..], @@ -177,7 +176,7 @@ fn proxy_should_be_initialized_correctly() { controller_code.extend_from_slice(H256::from(deployer()).as_bytes()); let controller = deploy_contract_code(controller_code, deployer()); let implementation = deploy_contract("Treasury-Implementation", deployer()); - let mut implementation_init = EvmDataWriter::new_with_selector(Function::Initialize) + let implementation_init = EvmDataWriter::new_with_selector(Function::Initialize) .write(H256::from(EvmAddress::default())) .build(); let (res, _) = Executor::::call( @@ -193,10 +192,10 @@ fn proxy_should_be_initialized_correctly() { assert_eq!(res, Succeed(Stopped), "Failed to initialize implementation"); // Act - let mut payload = EvmDataWriter::new_with_selector(Function::Initialize) - .write(H256::from(implementation)) + let payload = EvmDataWriter::new_with_selector(Function::Initialize) + .write(H256::from(controller)) .build(); - let mut proxy_init = EvmDataWriter::new_with_selector(Function::InitializePayload) + let proxy_init = EvmDataWriter::new_with_selector(Function::InitializePayload) .write(H256::from(implementation)) .write(H256::from(deployer())) .write(Bytes(payload)) From cdfb7fed9f5fb906b57cb59ad90974ab9f38b721 Mon Sep 17 00:00:00 2001 From: mrq Date: Mon, 30 Sep 2024 16:30:52 +0200 Subject: [PATCH 51/57] allow delegate call for contracts --- runtime/hydradx/src/evm/precompiles/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/runtime/hydradx/src/evm/precompiles/mod.rs b/runtime/hydradx/src/evm/precompiles/mod.rs index bd1439fa4..1447d579a 100644 --- a/runtime/hydradx/src/evm/precompiles/mod.rs +++ b/runtime/hydradx/src/evm/precompiles/mod.rs @@ -111,11 +111,11 @@ where let context = handle.context(); let address = handle.code_address(); - // Filter known precompile addresses except Ethereum officials - if address > ETH_PRECOMPILE_END && context.address != address { + // Disallow calling custom precompiles with DELEGATECALL or CALLCODE + if context.address != address && is_precompile(address) && !is_standard_precompile(address) { return Some(Err(PrecompileFailure::Revert { exit_status: ExitRevert::Reverted, - output: "cannot be called with DELEGATECALL or CALLCODE".into(), + output: "precompile cannot be called with DELEGATECALL or CALLCODE".into(), })); } From dc7452507f3114480f503c6be070d46898f5c76f Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 3 Oct 2024 16:59:59 +0200 Subject: [PATCH 52/57] make release works on macos as well --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 07c8c5003..b061b4f41 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,11 @@ cargo := cargo --config net.git-fetch-with-cli=true +ifeq ($(shell uname),Darwin) + # macOS-specific commands + sha256sum := shasum -a 256 +else + # Default commands for other systems + sha256sum := sha256sum +endif .PHONY: build build: @@ -62,9 +69,9 @@ docker: docker build -t hydra-dx . checksum: - sha256sum target/release/hydradx > target/release/hydradx.sha256 + $(sha256sum) target/release/hydradx > target/release/hydradx.sha256 cp target/release/wbuild/hydradx-runtime/hydradx_runtime.compact.compressed.wasm target/release/ - sha256sum target/release/hydradx_runtime.compact.compressed.wasm > target/release/hydradx_runtime.compact.compressed.wasm.sha256 + $(sha256sum) target/release/hydradx_runtime.compact.compressed.wasm > target/release/hydradx_runtime.compact.compressed.wasm.sha256 release: build-release checksum From 8ab3532d3ddef70137f90c4ee1da57f00c16cdf5 Mon Sep 17 00:00:00 2001 From: mrq Date: Fri, 4 Oct 2024 11:41:52 +0200 Subject: [PATCH 53/57] dat clippy life --- integration-tests/src/contracts.rs | 5 +---- runtime/hydradx/src/evm/precompiles/erc20_mapping.rs | 8 ++++---- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/integration-tests/src/contracts.rs b/integration-tests/src/contracts.rs index b110455d9..2082e8a1e 100644 --- a/integration-tests/src/contracts.rs +++ b/integration-tests/src/contracts.rs @@ -56,10 +56,7 @@ fn is_contract(checker: EvmAddress, address: EvmAddress) -> bool { origin: Default::default(), }; let (res, _) = Executor::::call(context, data, U256::zero(), 100_000); - match res { - Succeed(_) => true, - _ => false, - } + matches!(res, Succeed(_)) } #[test] diff --git a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs index e9e65d20f..a8be96d75 100644 --- a/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs +++ b/runtime/hydradx/src/evm/precompiles/erc20_mapping.rs @@ -76,9 +76,9 @@ pub struct SetCodeForErc20Precompile; impl RegisterAssetHook for SetCodeForErc20Precompile { fn on_register_asset(asset_id: AssetId) { - HydraErc20Mapping::encode_evm_address(asset_id).map(|evm_address| { + if let Some(evm_address) = HydraErc20Mapping::encode_evm_address(asset_id) { pallet_evm::AccountCodes::::insert(evm_address, &hex!["00"][..]); - }); + } } } @@ -88,12 +88,12 @@ impl frame_support::traits::OnRuntimeUpgrade for SetCodeForErc20Precompile { let mut writes = 0; pallet_asset_registry::Assets::::iter().for_each(|(asset_id, _)| { reads += 1; - HydraErc20Mapping::encode_evm_address(asset_id).map(|evm_address| { + if let Some(evm_address) = HydraErc20Mapping::encode_evm_address(asset_id) { if !pallet_evm::AccountCodes::::contains_key(evm_address) { Self::on_register_asset(asset_id); writes += 1; } - }); + } }); ::DbWeight::get().reads_writes(reads, writes) } From 3bc72ced8092f997ca83f39d624bc7bd7be3afc3 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 9 Oct 2024 11:37:13 +0200 Subject: [PATCH 54/57] bring it back,pls --- runtime/hydradx/src/lib.rs | 80 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index a1358ac3b..d836004a7 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -552,6 +552,86 @@ impl_runtime_apis! { } } + impl pallet_currencies_rpc_runtime_api::CurrenciesApi< + Block, + AssetId, + AccountId, + Balance, + > for Runtime { + fn account(asset_id: AssetId, who: AccountId) -> AccountData { + if asset_id == NativeAssetId::get() { + let data = System::account(&who).data; + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + } else if matches!(AssetRegistry::asset_type(asset_id), Some(AssetKind::Erc20)) { + AccountData { + free: Self::free_balance(asset_id, who), + ..Default::default() + } + } else { + let data = Tokens::accounts(who, asset_id); + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + } + } + + fn accounts(who: AccountId) -> Vec<(AssetId, AccountData)> { + let mut result = Vec::new(); + + let balance = System::account(&who).data; + result.push(( + NativeAssetId::get(), + AccountData { + free: balance.free, + reserved: balance.reserved, + frozen: balance.frozen, + } + )); + + result.extend( + orml_tokens::Accounts::::iter_prefix(&who) + .map(|(asset_id, data)| ( + asset_id, + AccountData { + free: data.free, + reserved: data.reserved, + frozen: data.frozen, + } + )) + ); + + result.extend( + pallet_asset_registry::Assets::::iter() + .filter(|(_, info)| info.asset_type == AssetType::Erc20) + .filter_map(|(asset_id, _)| { + let free = Self::free_balance(asset_id, who.clone()); + if free > 0 { + Some(( + asset_id, + AccountData { + free, + ..Default::default() + } + )) + } else { + None + } + }) + ); + + result + } + + fn free_balance(asset_id: AssetId, who: AccountId) -> Balance { + Currencies::free_balance(asset_id, &who) + } + } impl frame_system_rpc_runtime_api::AccountNonceApi for Runtime { fn account_nonce(account: AccountId) -> Index { From 7f07760ef21d7c8b5c934096d99e4bb33e88bf74 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 9 Oct 2024 12:51:25 +0200 Subject: [PATCH 55/57] runtime 262 --- Cargo.lock | 2 +- Makefile | 1 + runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/lib.rs | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d88c607c4..a9e1eba4c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "261.0.0" +version = "262.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/Makefile b/Makefile index b061b4f41..47d5ff87a 100644 --- a/Makefile +++ b/Makefile @@ -67,6 +67,7 @@ clean: .PHONY: docker docker: docker build -t hydra-dx . + docker tag hydra-dx galacticcouncil/hydra-dx:latest checksum: $(sha256sum) target/release/hydradx > target/release/hydradx.sha256 diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 4683e375d..91d54a5b3 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "261.0.0" +version = "262.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index d836004a7..bad93275f 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 261, + spec_version: 262, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, From b4df0545fce92f28e5f76d5e0aca1777621e2540 Mon Sep 17 00:00:00 2001 From: mrq Date: Wed, 16 Oct 2024 19:45:51 +0200 Subject: [PATCH 56/57] 263 --- Cargo.lock | 2 +- integration-tests/src/evm.rs | 32 ++++++++++++++++++++++++++++++++ runtime/hydradx/Cargo.toml | 2 +- runtime/hydradx/src/lib.rs | 8 ++++---- 4 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9e1eba4c..753f8e2b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "262.0.0" +version = "263.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", diff --git a/integration-tests/src/evm.rs b/integration-tests/src/evm.rs index a9b7c734e..d8470310a 100644 --- a/integration-tests/src/evm.rs +++ b/integration-tests/src/evm.rs @@ -319,6 +319,38 @@ mod account_conversion { ); }); } + + #[test] + fn estimation_of_evm_call_should_be_accepted_even_from_bound_address() { + TestNet::reset(); + + Hydra::execute_with(|| { + //Arrange + let data = + hex!["4d0045544800d1820d45118d78d091e685490c674d7596e62d1f0000000000000000140000000f0000c16ff28623"] + .to_vec(); + + assert_ok!(EVMAccounts::bind_evm_address(hydradx_runtime::RuntimeOrigin::signed( + ALICE.into() + )),); + + let evm_address = EVMAccounts::evm_address(&Into::::into(ALICE)); + + //Act & Assert + assert_ok!(hydradx_runtime::Runtime::call( + evm_address, // from + DISPATCH_ADDR, // to + data, // data + U256::from(1000u64), + U256::from(100000u64), + None, + None, + None, + true, + None, + )); + }); + } } mod standard_precompiles { diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 91d54a5b3..583458611 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "262.0.0" +version = "263.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index bad93275f..2dfccc8f8 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 262, + spec_version: 263, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, @@ -746,7 +746,7 @@ impl_runtime_apis! { }; // don't allow calling EVM RPC or Runtime API from a bound address - if EVMAccounts::bound_account_id(from).is_some() { + if !estimate && EVMAccounts::bound_account_id(from).is_some() { return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) }; @@ -827,9 +827,9 @@ impl_runtime_apis! { }; // don't allow calling EVM RPC or Runtime API from a bound address - if EVMAccounts::bound_account_id(from).is_some() { + if !estimate && EVMAccounts::bound_account_id(from).is_some() { return Err(pallet_evm_accounts::Error::::BoundAddressCannotBeUsed.into()) - }; + }; // the address needs to have a permission to deploy smart contract if !EVMAccounts::can_deploy_contracts(from) { From b11e66a5ec955d3a5783596bf199a0afb56e5b93 Mon Sep 17 00:00:00 2001 From: mrq Date: Thu, 17 Oct 2024 13:35:33 +0200 Subject: [PATCH 57/57] versions bump --- Cargo.lock | 32 +++++++++---------- node/Cargo.toml | 2 +- pallets/claims/Cargo.toml | 2 +- pallets/dca/Cargo.toml | 2 +- pallets/duster/Cargo.toml | 2 +- pallets/dynamic-evm-fee/Cargo.toml | 2 +- pallets/genesis-history/Cargo.toml | 2 +- pallets/otc-settlements/Cargo.toml | 2 +- pallets/otc/Cargo.toml | 2 +- pallets/referrals/Cargo.toml | 2 +- pallets/route-executor/Cargo.toml | 2 +- pallets/transaction-multi-payment/Cargo.toml | 4 +-- pallets/xyk/Cargo.toml | 4 +-- runtime/adapters/Cargo.toml | 4 +-- runtime/hydradx/Cargo.toml | 2 +- .../hydradx/src/evm/evm-utility/Cargo.toml | 4 +-- runtime/hydradx/src/lib.rs | 2 +- traits/Cargo.toml | 10 +++--- 18 files changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c10c28344..f2ed43455 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4775,7 +4775,7 @@ dependencies = [ [[package]] name = "hydradx" -version = "14.0.1" +version = "14.0.2" dependencies = [ "async-trait", "clap 4.5.4", @@ -4868,7 +4868,7 @@ dependencies = [ [[package]] name = "hydradx-adapters" -version = "1.3.6" +version = "1.3.7" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -4918,7 +4918,7 @@ dependencies = [ [[package]] name = "hydradx-runtime" -version = "263.0.0" +version = "264.0.0" dependencies = [ "cumulus-pallet-aura-ext", "cumulus-pallet-parachain-system", @@ -5057,7 +5057,7 @@ dependencies = [ [[package]] name = "hydradx-traits" -version = "3.7.1" +version = "3.7.2" dependencies = [ "frame-support", "impl-trait-for-tuples", @@ -6683,7 +6683,7 @@ dependencies = [ [[package]] name = "module-evm-utility" -version = "2.21.1" +version = "2.21.2" dependencies = [ "ethereum", "evm", @@ -7852,7 +7852,7 @@ dependencies = [ [[package]] name = "pallet-claims" -version = "3.4.10" +version = "3.4.11" dependencies = [ "frame-benchmarking", "frame-support", @@ -7983,7 +7983,7 @@ dependencies = [ [[package]] name = "pallet-dca" -version = "1.6.1" +version = "1.6.2" dependencies = [ "cumulus-pallet-parachain-system", "cumulus-primitives-core", @@ -8060,7 +8060,7 @@ dependencies = [ [[package]] name = "pallet-duster" -version = "3.2.6" +version = "3.2.7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8084,7 +8084,7 @@ dependencies = [ [[package]] name = "pallet-dynamic-evm-fee" -version = "1.0.3" +version = "1.0.4" dependencies = [ "frame-benchmarking", "frame-support", @@ -8393,7 +8393,7 @@ dependencies = [ [[package]] name = "pallet-genesis-history" -version = "2.1.3" +version = "2.1.4" dependencies = [ "derive_more", "frame-support", @@ -8790,7 +8790,7 @@ dependencies = [ [[package]] name = "pallet-otc" -version = "2.0.2" +version = "2.0.3" dependencies = [ "frame-benchmarking", "frame-support", @@ -8812,7 +8812,7 @@ dependencies = [ [[package]] name = "pallet-otc-settlements" -version = "1.0.4" +version = "1.0.5" dependencies = [ "frame-benchmarking", "frame-support", @@ -8947,7 +8947,7 @@ dependencies = [ [[package]] name = "pallet-referrals" -version = "1.2.6" +version = "1.2.7" dependencies = [ "frame-benchmarking", "frame-support", @@ -8998,7 +8998,7 @@ dependencies = [ [[package]] name = "pallet-route-executor" -version = "2.6.1" +version = "2.6.2" dependencies = [ "frame-benchmarking", "frame-support", @@ -9272,7 +9272,7 @@ dependencies = [ [[package]] name = "pallet-transaction-multi-payment" -version = "10.1.1" +version = "10.1.2" dependencies = [ "frame-support", "frame-system", @@ -9488,7 +9488,7 @@ dependencies = [ [[package]] name = "pallet-xyk" -version = "6.5.2" +version = "6.5.3" dependencies = [ "frame-benchmarking", "frame-support", diff --git a/node/Cargo.toml b/node/Cargo.toml index 39fd72716..466d4b58f 100644 --- a/node/Cargo.toml +++ b/node/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx" -version = "14.0.1" +version = "14.0.2" description = "Hydration node" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/claims/Cargo.toml b/pallets/claims/Cargo.toml index 0d37316af..0351b4901 100644 --- a/pallets/claims/Cargo.toml +++ b/pallets/claims/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-claims' -version = '3.4.10' +version = '3.4.11' description = 'HydraDX Claims Module' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/dca/Cargo.toml b/pallets/dca/Cargo.toml index 03d8fe8ac..eef6231b7 100644 --- a/pallets/dca/Cargo.toml +++ b/pallets/dca/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-dca' -version = "1.6.1" +version = "1.6.2" description = 'A pallet to manage DCA scheduling' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/duster/Cargo.toml b/pallets/duster/Cargo.toml index 7ac005264..53900ed19 100644 --- a/pallets/duster/Cargo.toml +++ b/pallets/duster/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-duster" -version = "3.2.6" +version = "3.2.7" description = "Account duster" authors = ["GalacticCouncil"] edition = "2021" diff --git a/pallets/dynamic-evm-fee/Cargo.toml b/pallets/dynamic-evm-fee/Cargo.toml index f3ca3c515..25e140441 100644 --- a/pallets/dynamic-evm-fee/Cargo.toml +++ b/pallets/dynamic-evm-fee/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-dynamic-evm-fee" -version = "1.0.3" +version = "1.0.4" description = "Storing and mutating the dynamic fee for EVM transactions." authors = ["GalacticCoucil"] edition = "2021" diff --git a/pallets/genesis-history/Cargo.toml b/pallets/genesis-history/Cargo.toml index 352d3e0fc..165b2bfca 100644 --- a/pallets/genesis-history/Cargo.toml +++ b/pallets/genesis-history/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-genesis-history" -version = "2.1.3" +version = "2.1.4" description = "Keeping track of the past chain generations." authors = ["GalacticCouncil "] edition = "2021" diff --git a/pallets/otc-settlements/Cargo.toml b/pallets/otc-settlements/Cargo.toml index 299418e68..c3cffd3a5 100644 --- a/pallets/otc-settlements/Cargo.toml +++ b/pallets/otc-settlements/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-otc-settlements' -version = '1.0.4' +version = '1.0.5' description = 'A pallet with offchain worker closing OTC arbs' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/otc/Cargo.toml b/pallets/otc/Cargo.toml index 68775dc23..20178b2cd 100644 --- a/pallets/otc/Cargo.toml +++ b/pallets/otc/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-otc' -version = '2.0.2' +version = '2.0.3' description = 'A pallet for trustless over-the-counter trading' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/referrals/Cargo.toml b/pallets/referrals/Cargo.toml index 5fe6b5fa6..9f0aba73b 100644 --- a/pallets/referrals/Cargo.toml +++ b/pallets/referrals/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-referrals" -version = "1.2.6" +version = "1.2.7" authors = ['GalacticCouncil'] edition = "2021" license = "Apache-2.0" diff --git a/pallets/route-executor/Cargo.toml b/pallets/route-executor/Cargo.toml index c57877a0f..6078639b5 100644 --- a/pallets/route-executor/Cargo.toml +++ b/pallets/route-executor/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-route-executor' -version = '2.6.1' +version = '2.6.2' description = 'A pallet to execute a route containing a sequence of trades' authors = ['GalacticCouncil'] edition = '2021' diff --git a/pallets/transaction-multi-payment/Cargo.toml b/pallets/transaction-multi-payment/Cargo.toml index 6bc89f94b..86163edca 100644 --- a/pallets/transaction-multi-payment/Cargo.toml +++ b/pallets/transaction-multi-payment/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "pallet-transaction-multi-payment" -version = "10.1.1" +version = "10.1.2" description = "Transaction multi currency payment support module" authors = ["GalacticCoucil"] edition = "2021" @@ -21,7 +21,7 @@ orml-traits = { workspace = true } hydradx-traits = { workspace = true } primitives = { workspace = true } hydra-dx-math = { workspace = true } -pallet-xyk = {workspace = true} +pallet-xyk = { workspace = true } # Substrate dependencies frame-support = { workspace = true } diff --git a/pallets/xyk/Cargo.toml b/pallets/xyk/Cargo.toml index f26aaf7df..0547a1d55 100644 --- a/pallets/xyk/Cargo.toml +++ b/pallets/xyk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = 'pallet-xyk' -version = "6.5.2" +version = "6.5.3" description = 'XYK automated market maker' authors = ['GalacticCouncil'] edition = '2021' @@ -15,7 +15,7 @@ targets = ['x86_64-unknown-linux-gnu'] substrate-wasm-builder = { workspace = true } [dependencies] -codec = {workspace = true } +codec = { workspace = true } scale-info = { workspace = true } primitive-types = { workspace = true } serde = { workspace = true, optional = true } diff --git a/runtime/adapters/Cargo.toml b/runtime/adapters/Cargo.toml index 0cf8fee70..a7ff45676 100644 --- a/runtime/adapters/Cargo.toml +++ b/runtime/adapters/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-adapters" -version = "1.3.6" +version = "1.3.7" description = "Structs and other generic types for building runtimes." authors = ["GalacticCouncil"] edition = "2021" @@ -8,7 +8,7 @@ license = "Apache 2.0" repository = "https://github.com/galacticcouncil/warehouse/tree/master/adapters" [dependencies] -codec = {workspace = true } +codec = { workspace = true } log = { workspace = true } scale-info = { workspace = true } diff --git a/runtime/hydradx/Cargo.toml b/runtime/hydradx/Cargo.toml index 583458611..2763a8943 100644 --- a/runtime/hydradx/Cargo.toml +++ b/runtime/hydradx/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-runtime" -version = "263.0.0" +version = "264.0.0" authors = ["GalacticCouncil"] edition = "2021" license = "Apache 2.0" diff --git a/runtime/hydradx/src/evm/evm-utility/Cargo.toml b/runtime/hydradx/src/evm/evm-utility/Cargo.toml index d0db05424..c199f2130 100644 --- a/runtime/hydradx/src/evm/evm-utility/Cargo.toml +++ b/runtime/hydradx/src/evm/evm-utility/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "module-evm-utility" -version = "2.21.1" +version = "2.21.2" authors = ["Acala Developers"] edition = "2021" @@ -14,7 +14,7 @@ sp-std = { workspace = true } evm = { workspace = true, features = ["with-codec"] } evm-gasometer = { workspace = true } evm-runtime = { workspace = true } -ethereum = { workspace = true } +ethereum = { workspace = true } [features] default = ["std"] diff --git a/runtime/hydradx/src/lib.rs b/runtime/hydradx/src/lib.rs index 2dfccc8f8..c43d03c37 100644 --- a/runtime/hydradx/src/lib.rs +++ b/runtime/hydradx/src/lib.rs @@ -112,7 +112,7 @@ pub const VERSION: RuntimeVersion = RuntimeVersion { spec_name: create_runtime_str!("hydradx"), impl_name: create_runtime_str!("hydradx"), authoring_version: 1, - spec_version: 263, + spec_version: 264, impl_version: 0, apis: RUNTIME_API_VERSIONS, transaction_version: 1, diff --git a/traits/Cargo.toml b/traits/Cargo.toml index 18e42626c..c4c4690ae 100644 --- a/traits/Cargo.toml +++ b/traits/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hydradx-traits" -version = "3.7.1" +version = "3.7.2" description = "Shared traits" authors = ["GalacticCouncil"] edition = "2021" @@ -8,10 +8,10 @@ license = "Apache 2.0" repository = "https://github.com/galacticcouncil/warehouse/tree/master/traits" [dependencies] -codec = { workspace = true } -scale-info = { workspace = true } -serde = { workspace = true } -impl-trait-for-tuples = { workspace = true } +codec = { workspace = true } +scale-info = { workspace = true } +serde = { workspace = true } +impl-trait-for-tuples = { workspace = true } sp-arithmetic = { workspace = true } # Substrate dependencies