diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 000000000..deed13c01 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +lts/jod diff --git a/CHANGELOG.md b/CHANGELOG.md index 82c7e5ad5..79d291174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ only on the "bankkeeper.BaseKeeper"'s gas consumption. Remove unnecessary argument in the `VerifyFee` function, which returns the token payment required based on the effective fee from the tx data. Improve documentation. +- [#2125](https://github.com/NibiruChain/nibiru/pull/2125) - feat(evm-precompile):Emit EVM events created to reflect the ABCI events that occur outside the EVM to make sure that block explorers and indexers can find indexed ABCI event information. - [#2129](https://github.com/NibiruChain/nibiru/pull/2129) - fix(evm): issue with infinite recursion in erc20 funtoken contracts #### Nibiru EVM | Before Audit 2 - 2024-12-06 diff --git a/contrib/bashlib.sh b/contrib/bashlib.sh index 2279cc456..98c68d899 100644 --- a/contrib/bashlib.sh +++ b/contrib/bashlib.sh @@ -29,26 +29,26 @@ export COLOR_BRIGHT_WHITE="\033[97m" # log_debug: Simple wrapper for `echo` with a DEBUG prefix. log_debug() { - echo "${COLOR_CYAN}DEBUG${COLOR_RESET}" "$@" + echo -e "${COLOR_CYAN}DEBUG${COLOR_RESET}" "$@" } # log_error: ERROR messages in red, output to stderr. log_error() { - echo "❌ ${COLOR_RED}ERROR:${COLOR_RESET}" "$@" >&2 + echo -e "❌ ${COLOR_RED}ERROR:${COLOR_RESET}" "$@" >&2 } log_success() { - echo "${COLOR_GREEN}✅ SUCCESS:${COLOR_RESET}" "$@" + echo -e "${COLOR_GREEN}✅ SUCCESS:${COLOR_RESET}" "$@" } # log_warning: WARNING messages represent non-critical issues that might not # require immediate action but should be noted as points of concern or failure. log_warning() { - echo "${COLOR_YELLOW}WARNING${COLOR_RESET}" "$@" >&2 + echo -e "${COLOR_YELLOW}WARNING${COLOR_RESET}" "$@" >&2 } log_info() { - echo "${COLOR_MAGENTA}INFO${COLOR_RESET}" "$@" + echo -e "${COLOR_MAGENTA}INFO${COLOR_RESET}" "$@" } # ————————————————————————————————————————————————— diff --git a/justfile b/justfile index bfdd90458..77b6e1aaf 100644 --- a/justfile +++ b/justfile @@ -20,17 +20,29 @@ build: clean-cache: go clean -cache -testcache -modcache -alias b := build - -# Generate protobuf code (Golang) for Nibiru +# Generate protobuf-based types in Golang proto-gen: #!/usr/bin/env bash make proto-gen -alias proto := proto-gen +# Generate Solidity artifacts for x/evm/embeds +gen-embeds: + #!/usr/bin/env bash + source contrib/bashlib.sh + + embeds_dir="x/evm/embeds" + log_info "Begin to compile Solidity in $embeds_dir" + which_ok npm + log_info "Using system node version: $(npm exec -- node -v)" + + cd "$embeds_dir" || (log_error "path $embeds_dir not found" && exit) + npx hardhat compile + log_success "Compiled Solidity in $embeds_dir" + +alias gen-proto := proto-gen -# Build protobuf types (Rust) -proto-rs: +# Generate protobuf-based types in Rust +gen-proto-rs: bash proto/buf.gen.rs.sh lint: diff --git a/x/evm/embeds/artifacts/contracts/IFunToken.sol/IFunToken.json b/x/evm/embeds/artifacts/contracts/IFunToken.sol/IFunToken.json index 5877e277b..39c5d7aef 100644 --- a/x/evm/embeds/artifacts/contracts/IFunToken.sol/IFunToken.json +++ b/x/evm/embeds/artifacts/contracts/IFunToken.sol/IFunToken.json @@ -3,6 +3,25 @@ "contractName": "IFunToken", "sourceName": "contracts/IFunToken.sol", "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "eventType", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "abciEvent", + "type": "string" + } + ], + "name": "AbciEvent", + "type": "event" + }, { "inputs": [ { diff --git a/x/evm/embeds/artifacts/contracts/NibiruEvmUtils.sol/INibiruEvm.json b/x/evm/embeds/artifacts/contracts/NibiruEvmUtils.sol/INibiruEvm.json new file mode 100644 index 000000000..9704d7497 --- /dev/null +++ b/x/evm/embeds/artifacts/contracts/NibiruEvmUtils.sol/INibiruEvm.json @@ -0,0 +1,30 @@ +{ + "_format": "hh-sol-artifact-1", + "contractName": "INibiruEvm", + "sourceName": "contracts/NibiruEvmUtils.sol", + "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "eventType", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "abciEvent", + "type": "string" + } + ], + "name": "AbciEvent", + "type": "event" + } + ], + "bytecode": "0x", + "deployedBytecode": "0x", + "linkReferences": {}, + "deployedLinkReferences": {} +} diff --git a/x/evm/embeds/artifacts/contracts/TestERC20TransferThenPrecompileSend.sol/TestERC20TransferThenPrecompileSend.json b/x/evm/embeds/artifacts/contracts/TestERC20TransferThenPrecompileSend.sol/TestERC20TransferThenPrecompileSend.json index a01b550fc..7e02b8803 100644 --- a/x/evm/embeds/artifacts/contracts/TestERC20TransferThenPrecompileSend.sol/TestERC20TransferThenPrecompileSend.json +++ b/x/evm/embeds/artifacts/contracts/TestERC20TransferThenPrecompileSend.sol/TestERC20TransferThenPrecompileSend.json @@ -43,8 +43,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50604051610c4c380380610c4c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610b35806101176000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063264c325814610030575b600080fd5b61004a6004803603810190610045919061065c565b61004c565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b81526004016100a792919061074d565b6020604051808303816000875af11580156100c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ea91906107ae565b610129576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012090610838565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b815260040161018a939291906108e7565b6020604051808303816000875af11580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061093a565b90508181146101db8261024d565b6101e48461024d565b6040516020016101f5929190610a61565b60405160208183030381529060405290610245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023c9190610aae565b60405180910390fd5b505050505050565b60606000600161025c8461031b565b01905060008167ffffffffffffffff81111561027b5761027a610531565b5b6040519080825280601f01601f1916602001820160405280156102ad5781602001600182028036833780820191505090505b509050600082602001820190505b600115610310578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161030457610303610ad0565b5b049450600085036102bb575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310610379577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161036f5761036e610ad0565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106103b6576d04ee2d6d415b85acef810000000083816103ac576103ab610ad0565b5b0492506020810190505b662386f26fc1000083106103e557662386f26fc1000083816103db576103da610ad0565b5b0492506010810190505b6305f5e100831061040e576305f5e100838161040457610403610ad0565b5b0492506008810190505b612710831061043357612710838161042957610428610ad0565b5b0492506004810190505b60648310610456576064838161044c5761044b610ad0565b5b0492506002810190505b600a8310610465576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104ad82610482565b9050919050565b6104bd816104a2565b81146104c857600080fd5b50565b6000813590506104da816104b4565b92915050565b6000819050919050565b6104f3816104e0565b81146104fe57600080fd5b50565b600081359050610510816104ea565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61056982610520565b810181811067ffffffffffffffff8211171561058857610587610531565b5b80604052505050565b600061059b61046e565b90506105a78282610560565b919050565b600067ffffffffffffffff8211156105c7576105c6610531565b5b6105d082610520565b9050602081019050919050565b82818337600083830152505050565b60006105ff6105fa846105ac565b610591565b90508281526020810184848401111561061b5761061a61051b565b5b6106268482856105dd565b509392505050565b600082601f83011261064357610642610516565b5b81356106538482602086016105ec565b91505092915050565b6000806000806080858703121561067657610675610478565b5b6000610684878288016104cb565b945050602061069587828801610501565b935050604085013567ffffffffffffffff8111156106b6576106b561047d565b5b6106c28782880161062e565b92505060606106d387828801610501565b91505092959194509250565b6000819050919050565b60006107046106ff6106fa84610482565b6106df565b610482565b9050919050565b6000610716826106e9565b9050919050565b60006107288261070b565b9050919050565b6107388161071d565b82525050565b610747816104e0565b82525050565b6000604082019050610762600083018561072f565b61076f602083018461073e565b9392505050565b60008115159050919050565b61078b81610776565b811461079657600080fd5b50565b6000815190506107a881610782565b92915050565b6000602082840312156107c4576107c3610478565b5b60006107d284828501610799565b91505092915050565b600082825260208201905092915050565b7f4552432d3230207472616e73666572206661696c656400000000000000000000600082015250565b60006108226016836107db565b915061082d826107ec565b602082019050919050565b6000602082019050818103600083015261085181610815565b9050919050565b600061086382610482565b9050919050565b61087381610858565b82525050565b600081519050919050565b60005b838110156108a2578082015181840152602081019050610887565b60008484015250505050565b60006108b982610879565b6108c381856107db565b93506108d3818560208601610884565b6108dc81610520565b840191505092915050565b60006060820190506108fc600083018661086a565b610909602083018561073e565b818103604083015261091b81846108ae565b9050949350505050565b600081519050610934816104ea565b92915050565b6000602082840312156109505761094f610478565b5b600061095e84828501610925565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109ce603f83610967565b91506109d982610972565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b6000610a1582610879565b610a1f8185610967565b9350610a2f818560208601610884565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a6c826109c1565b9150610a77826109e4565b600b82019150610a878285610a0a565b9150610a9282610a3b565b600982019150610aa28284610a0a565b91508190509392505050565b60006020820190508181036000830152610ac881846108ae565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122042f899f7461653cf1df35f26f5f40f53e56c43892fd0cebd16ecff8d5f83285464736f6c63430008180033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063264c325814610030575b600080fd5b61004a6004803603810190610045919061065c565b61004c565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b81526004016100a792919061074d565b6020604051808303816000875af11580156100c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ea91906107ae565b610129576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012090610838565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b815260040161018a939291906108e7565b6020604051808303816000875af11580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061093a565b90508181146101db8261024d565b6101e48461024d565b6040516020016101f5929190610a61565b60405160208183030381529060405290610245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023c9190610aae565b60405180910390fd5b505050505050565b60606000600161025c8461031b565b01905060008167ffffffffffffffff81111561027b5761027a610531565b5b6040519080825280601f01601f1916602001820160405280156102ad5781602001600182028036833780820191505090505b509050600082602001820190505b600115610310578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161030457610303610ad0565b5b049450600085036102bb575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310610379577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161036f5761036e610ad0565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106103b6576d04ee2d6d415b85acef810000000083816103ac576103ab610ad0565b5b0492506020810190505b662386f26fc1000083106103e557662386f26fc1000083816103db576103da610ad0565b5b0492506010810190505b6305f5e100831061040e576305f5e100838161040457610403610ad0565b5b0492506008810190505b612710831061043357612710838161042957610428610ad0565b5b0492506004810190505b60648310610456576064838161044c5761044b610ad0565b5b0492506002810190505b600a8310610465576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104ad82610482565b9050919050565b6104bd816104a2565b81146104c857600080fd5b50565b6000813590506104da816104b4565b92915050565b6000819050919050565b6104f3816104e0565b81146104fe57600080fd5b50565b600081359050610510816104ea565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61056982610520565b810181811067ffffffffffffffff8211171561058857610587610531565b5b80604052505050565b600061059b61046e565b90506105a78282610560565b919050565b600067ffffffffffffffff8211156105c7576105c6610531565b5b6105d082610520565b9050602081019050919050565b82818337600083830152505050565b60006105ff6105fa846105ac565b610591565b90508281526020810184848401111561061b5761061a61051b565b5b6106268482856105dd565b509392505050565b600082601f83011261064357610642610516565b5b81356106538482602086016105ec565b91505092915050565b6000806000806080858703121561067657610675610478565b5b6000610684878288016104cb565b945050602061069587828801610501565b935050604085013567ffffffffffffffff8111156106b6576106b561047d565b5b6106c28782880161062e565b92505060606106d387828801610501565b91505092959194509250565b6000819050919050565b60006107046106ff6106fa84610482565b6106df565b610482565b9050919050565b6000610716826106e9565b9050919050565b60006107288261070b565b9050919050565b6107388161071d565b82525050565b610747816104e0565b82525050565b6000604082019050610762600083018561072f565b61076f602083018461073e565b9392505050565b60008115159050919050565b61078b81610776565b811461079657600080fd5b50565b6000815190506107a881610782565b92915050565b6000602082840312156107c4576107c3610478565b5b60006107d284828501610799565b91505092915050565b600082825260208201905092915050565b7f4552432d3230207472616e73666572206661696c656400000000000000000000600082015250565b60006108226016836107db565b915061082d826107ec565b602082019050919050565b6000602082019050818103600083015261085181610815565b9050919050565b600061086382610482565b9050919050565b61087381610858565b82525050565b600081519050919050565b60005b838110156108a2578082015181840152602081019050610887565b60008484015250505050565b60006108b982610879565b6108c381856107db565b93506108d3818560208601610884565b6108dc81610520565b840191505092915050565b60006060820190506108fc600083018661086a565b610909602083018561073e565b818103604083015261091b81846108ae565b9050949350505050565b600081519050610934816104ea565b92915050565b6000602082840312156109505761094f610478565b5b600061095e84828501610925565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109ce603f83610967565b91506109d982610972565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b6000610a1582610879565b610a1f8185610967565b9350610a2f818560208601610884565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a6c826109c1565b9150610a77826109e4565b600b82019150610a878285610a0a565b9150610a9282610a3b565b600982019150610aa28284610a0a565b91508190509392505050565b60006020820190508181036000830152610ac881846108ae565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122042f899f7461653cf1df35f26f5f40f53e56c43892fd0cebd16ecff8d5f83285464736f6c63430008180033", + "bytecode": "0x608060405234801561001057600080fd5b50604051610c4c380380610c4c833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610b35806101176000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063264c325814610030575b600080fd5b61004a6004803603810190610045919061065c565b61004c565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b81526004016100a792919061074d565b6020604051808303816000875af11580156100c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ea91906107ae565b610129576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012090610838565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b815260040161018a939291906108e7565b6020604051808303816000875af11580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061093a565b90508181146101db8261024d565b6101e48461024d565b6040516020016101f5929190610a61565b60405160208183030381529060405290610245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023c9190610aae565b60405180910390fd5b505050505050565b60606000600161025c8461031b565b01905060008167ffffffffffffffff81111561027b5761027a610531565b5b6040519080825280601f01601f1916602001820160405280156102ad5781602001600182028036833780820191505090505b509050600082602001820190505b600115610310578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161030457610303610ad0565b5b049450600085036102bb575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310610379577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161036f5761036e610ad0565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106103b6576d04ee2d6d415b85acef810000000083816103ac576103ab610ad0565b5b0492506020810190505b662386f26fc1000083106103e557662386f26fc1000083816103db576103da610ad0565b5b0492506010810190505b6305f5e100831061040e576305f5e100838161040457610403610ad0565b5b0492506008810190505b612710831061043357612710838161042957610428610ad0565b5b0492506004810190505b60648310610456576064838161044c5761044b610ad0565b5b0492506002810190505b600a8310610465576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104ad82610482565b9050919050565b6104bd816104a2565b81146104c857600080fd5b50565b6000813590506104da816104b4565b92915050565b6000819050919050565b6104f3816104e0565b81146104fe57600080fd5b50565b600081359050610510816104ea565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61056982610520565b810181811067ffffffffffffffff8211171561058857610587610531565b5b80604052505050565b600061059b61046e565b90506105a78282610560565b919050565b600067ffffffffffffffff8211156105c7576105c6610531565b5b6105d082610520565b9050602081019050919050565b82818337600083830152505050565b60006105ff6105fa846105ac565b610591565b90508281526020810184848401111561061b5761061a61051b565b5b6106268482856105dd565b509392505050565b600082601f83011261064357610642610516565b5b81356106538482602086016105ec565b91505092915050565b6000806000806080858703121561067657610675610478565b5b6000610684878288016104cb565b945050602061069587828801610501565b935050604085013567ffffffffffffffff8111156106b6576106b561047d565b5b6106c28782880161062e565b92505060606106d387828801610501565b91505092959194509250565b6000819050919050565b60006107046106ff6106fa84610482565b6106df565b610482565b9050919050565b6000610716826106e9565b9050919050565b60006107288261070b565b9050919050565b6107388161071d565b82525050565b610747816104e0565b82525050565b6000604082019050610762600083018561072f565b61076f602083018461073e565b9392505050565b60008115159050919050565b61078b81610776565b811461079657600080fd5b50565b6000815190506107a881610782565b92915050565b6000602082840312156107c4576107c3610478565b5b60006107d284828501610799565b91505092915050565b600082825260208201905092915050565b7f4552432d3230207472616e73666572206661696c656400000000000000000000600082015250565b60006108226016836107db565b915061082d826107ec565b602082019050919050565b6000602082019050818103600083015261085181610815565b9050919050565b600061086382610482565b9050919050565b61087381610858565b82525050565b600081519050919050565b60005b838110156108a2578082015181840152602081019050610887565b60008484015250505050565b60006108b982610879565b6108c381856107db565b93506108d3818560208601610884565b6108dc81610520565b840191505092915050565b60006060820190506108fc600083018661086a565b610909602083018561073e565b818103604083015261091b81846108ae565b9050949350505050565b600081519050610934816104ea565b92915050565b6000602082840312156109505761094f610478565b5b600061095e84828501610925565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109ce603f83610967565b91506109d982610972565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b6000610a1582610879565b610a1f8185610967565b9350610a2f818560208601610884565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a6c826109c1565b9150610a77826109e4565b600b82019150610a878285610a0a565b9150610a9282610a3b565b600982019150610aa28284610a0a565b91508190509392505050565b60006020820190508181036000830152610ac881846108ae565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220ac87f92bb48cb96c0379f7c364f408a4b71d1e0ac35283db4a4b8e4963d94c4564736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063264c325814610030575b600080fd5b61004a6004803603810190610045919061065c565b61004c565b005b60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663a9059cbb85856040518363ffffffff1660e01b81526004016100a792919061074d565b6020604051808303816000875af11580156100c6573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906100ea91906107ae565b610129576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161012090610838565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b815260040161018a939291906108e7565b6020604051808303816000875af11580156101a9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101cd919061093a565b90508181146101db8261024d565b6101e48461024d565b6040516020016101f5929190610a61565b60405160208183030381529060405290610245576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161023c9190610aae565b60405180910390fd5b505050505050565b60606000600161025c8461031b565b01905060008167ffffffffffffffff81111561027b5761027a610531565b5b6040519080825280601f01601f1916602001820160405280156102ad5781602001600182028036833780820191505090505b509050600082602001820190505b600115610310578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161030457610303610ad0565b5b049450600085036102bb575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310610379577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161036f5761036e610ad0565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106103b6576d04ee2d6d415b85acef810000000083816103ac576103ab610ad0565b5b0492506020810190505b662386f26fc1000083106103e557662386f26fc1000083816103db576103da610ad0565b5b0492506010810190505b6305f5e100831061040e576305f5e100838161040457610403610ad0565b5b0492506008810190505b612710831061043357612710838161042957610428610ad0565b5b0492506004810190505b60648310610456576064838161044c5761044b610ad0565b5b0492506002810190505b600a8310610465576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006104ad82610482565b9050919050565b6104bd816104a2565b81146104c857600080fd5b50565b6000813590506104da816104b4565b92915050565b6000819050919050565b6104f3816104e0565b81146104fe57600080fd5b50565b600081359050610510816104ea565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61056982610520565b810181811067ffffffffffffffff8211171561058857610587610531565b5b80604052505050565b600061059b61046e565b90506105a78282610560565b919050565b600067ffffffffffffffff8211156105c7576105c6610531565b5b6105d082610520565b9050602081019050919050565b82818337600083830152505050565b60006105ff6105fa846105ac565b610591565b90508281526020810184848401111561061b5761061a61051b565b5b6106268482856105dd565b509392505050565b600082601f83011261064357610642610516565b5b81356106538482602086016105ec565b91505092915050565b6000806000806080858703121561067657610675610478565b5b6000610684878288016104cb565b945050602061069587828801610501565b935050604085013567ffffffffffffffff8111156106b6576106b561047d565b5b6106c28782880161062e565b92505060606106d387828801610501565b91505092959194509250565b6000819050919050565b60006107046106ff6106fa84610482565b6106df565b610482565b9050919050565b6000610716826106e9565b9050919050565b60006107288261070b565b9050919050565b6107388161071d565b82525050565b610747816104e0565b82525050565b6000604082019050610762600083018561072f565b61076f602083018461073e565b9392505050565b60008115159050919050565b61078b81610776565b811461079657600080fd5b50565b6000815190506107a881610782565b92915050565b6000602082840312156107c4576107c3610478565b5b60006107d284828501610799565b91505092915050565b600082825260208201905092915050565b7f4552432d3230207472616e73666572206661696c656400000000000000000000600082015250565b60006108226016836107db565b915061082d826107ec565b602082019050919050565b6000602082019050818103600083015261085181610815565b9050919050565b600061086382610482565b9050919050565b61087381610858565b82525050565b600081519050919050565b60005b838110156108a2578082015181840152602081019050610887565b60008484015250505050565b60006108b982610879565b6108c381856107db565b93506108d3818560208601610884565b6108dc81610520565b840191505092915050565b60006060820190506108fc600083018661086a565b610909602083018561073e565b818103604083015261091b81846108ae565b9050949350505050565b600081519050610934816104ea565b92915050565b6000602082840312156109505761094f610478565b5b600061095e84828501610925565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109ce603f83610967565b91506109d982610972565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b6000610a1582610879565b610a1f8185610967565b9350610a2f818560208601610884565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a6c826109c1565b9150610a77826109e4565b600b82019150610a878285610a0a565b9150610a9282610a3b565b600982019150610aa28284610a0a565b91508190509392505050565b60006020820190508181036000830152610ac881846108ae565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220ac87f92bb48cb96c0379f7c364f408a4b71d1e0ac35283db4a4b8e4963d94c4564736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/evm/embeds/artifacts/contracts/TestFunTokenPrecompileLocalGas.sol/TestFunTokenPrecompileLocalGas.json b/x/evm/embeds/artifacts/contracts/TestFunTokenPrecompileLocalGas.sol/TestFunTokenPrecompileLocalGas.json index 83481bdd5..95e833a22 100644 --- a/x/evm/embeds/artifacts/contracts/TestFunTokenPrecompileLocalGas.sol/TestFunTokenPrecompileLocalGas.json +++ b/x/evm/embeds/artifacts/contracts/TestFunTokenPrecompileLocalGas.sol/TestFunTokenPrecompileLocalGas.json @@ -56,8 +56,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50604051610b6a380380610b6a833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a53806101176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf8360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006108ec603f83610885565b91506108f782610890565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220518cb8e0a44ff5f83545c95e1dbc30a25da8ee95d0d23b6fac02d6a4c47c4c5164736f6c63430008180033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf8360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006108ec603f83610885565b91506108f782610890565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220518cb8e0a44ff5f83545c95e1dbc30a25da8ee95d0d23b6fac02d6a4c47c4c5164736f6c63430008180033", + "bytecode": "0x608060405234801561001057600080fd5b50604051610b6a380380610b6a833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610a53806101176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf8360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006108ec603f83610885565b91506108f782610890565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212201e8ad92ef8f92a3e60b70a83c52bfc446727e39e482a331186bfeb6a9b0b461964736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806359b6ed891461003b57806390d2b5e714610057575b600080fd5b6100556004803603810190610050919061066b565b610073565b005b610071600480360381019061006c91906106da565b610198565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf8360008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1687876040518563ffffffff1660e01b81526004016100d593929190610805565b60206040518083038160008887f11580156100f4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906101199190610858565b9050838114610127826102ba565b610130866102ba565b60405160200161014192919061097f565b60405160208183030381529060405290610191576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161018891906109cc565b60405180910390fd5b5050505050565b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685856040518463ffffffff1660e01b81526004016101f993929190610805565b6020604051808303816000875af1158015610218573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061023c9190610858565b905082811461024a826102ba565b610253856102ba565b60405160200161026492919061097f565b604051602081830303815290604052906102b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102ab91906109cc565b60405180910390fd5b50505050565b6060600060016102c984610388565b01905060008167ffffffffffffffff8111156102e8576102e7610540565b5b6040519080825280601f01601f19166020018201604052801561031a5781602001600182028036833780820191505090505b509050600082602001820190505b60011561037d578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581610371576103706109ee565b5b04945060008503610328575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103e6577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103dc576103db6109ee565b5b0492506040810190505b6d04ee2d6d415b85acef81000000008310610423576d04ee2d6d415b85acef81000000008381610419576104186109ee565b5b0492506020810190505b662386f26fc10000831061045257662386f26fc100008381610448576104476109ee565b5b0492506010810190505b6305f5e100831061047b576305f5e1008381610471576104706109ee565b5b0492506008810190505b61271083106104a0576127108381610496576104956109ee565b5b0492506004810190505b606483106104c357606483816104b9576104b86109ee565b5b0492506002810190505b600a83106104d2576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b6000819050919050565b610502816104ef565b811461050d57600080fd5b50565b60008135905061051f816104f9565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105788261052f565b810181811067ffffffffffffffff8211171561059757610596610540565b5b80604052505050565b60006105aa6104db565b90506105b6828261056f565b919050565b600067ffffffffffffffff8211156105d6576105d5610540565b5b6105df8261052f565b9050602081019050919050565b82818337600083830152505050565b600061060e610609846105bb565b6105a0565b90508281526020810184848401111561062a5761062961052a565b5b6106358482856105ec565b509392505050565b600082601f83011261065257610651610525565b5b81356106628482602086016105fb565b91505092915050565b600080600060608486031215610684576106836104e5565b5b600061069286828701610510565b935050602084013567ffffffffffffffff8111156106b3576106b26104ea565b5b6106bf8682870161063d565b92505060406106d086828701610510565b9150509250925092565b600080604083850312156106f1576106f06104e5565b5b60006106ff85828601610510565b925050602083013567ffffffffffffffff8111156107205761071f6104ea565b5b61072c8582860161063d565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076182610736565b9050919050565b61077181610756565b82525050565b610780816104ef565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b838110156107c05780820151818401526020810190506107a5565b60008484015250505050565b60006107d782610786565b6107e18185610791565b93506107f18185602086016107a2565b6107fa8161052f565b840191505092915050565b600060608201905061081a6000830186610768565b6108276020830185610777565b818103604083015261083981846107cc565b9050949350505050565b600081519050610852816104f9565b92915050565b60006020828403121561086e5761086d6104e5565b5b600061087c84828501610843565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006108ec603f83610885565b91506108f782610890565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061093382610786565b61093d8185610885565b935061094d8185602086016107a2565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b600061098a826108df565b915061099582610902565b600b820191506109a58285610928565b91506109b082610959565b6009820191506109c08284610928565b91508190509392505050565b600060208201905081810360008301526109e681846107cc565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212201e8ad92ef8f92a3e60b70a83c52bfc446727e39e482a331186bfeb6a9b0b461964736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/evm/embeds/artifacts/contracts/TestNativeSendThenPrecompileSend.sol/TestNativeSendThenPrecompileSend.json b/x/evm/embeds/artifacts/contracts/TestNativeSendThenPrecompileSend.sol/TestNativeSendThenPrecompileSend.json index 60af0f4ee..7891904a1 100644 --- a/x/evm/embeds/artifacts/contracts/TestNativeSendThenPrecompileSend.sol/TestNativeSendThenPrecompileSend.json +++ b/x/evm/embeds/artifacts/contracts/TestNativeSendThenPrecompileSend.sol/TestNativeSendThenPrecompileSend.json @@ -61,8 +61,8 @@ "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b50604051610ca1380380610ca1833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610b8a806101176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630a04fd4d1461003b578063a4de557414610057575b600080fd5b610055600480360381019061005091906106e4565b610073565b005b610071600480360381019061006c919061079e565b610195565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016100d4939291906108d0565b6020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610923565b905081811461012582610333565b61012e84610333565b60405160200161013f929190610a4a565b6040516020818303038152906040529061018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869190610a97565b60405180910390fd5b50505050565b60008473ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505090508061020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020590610b05565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685876040518463ffffffff1660e01b815260040161026f939291906108d0565b6020604051808303816000875af115801561028e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b29190610923565b90508281146102c082610333565b6102c985610333565b6040516020016102da929190610a4a565b6040516020818303038152906040529061032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219190610a97565b60405180910390fd5b50505050505050565b60606000600161034284610401565b01905060008167ffffffffffffffff81111561036157610360610583565b5b6040519080825280601f01601f1916602001820160405280156103935781602001600182028036833780820191505090505b509050600082602001820190505b6001156103f6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816103ea576103e9610b25565b5b049450600085036103a1575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061045f577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161045557610454610b25565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061049c576d04ee2d6d415b85acef8100000000838161049257610491610b25565b5b0492506020810190505b662386f26fc1000083106104cb57662386f26fc1000083816104c1576104c0610b25565b5b0492506010810190505b6305f5e10083106104f4576305f5e10083816104ea576104e9610b25565b5b0492506008810190505b612710831061051957612710838161050f5761050e610b25565b5b0492506004810190505b6064831061053c576064838161053257610531610b25565b5b0492506002810190505b600a831061054b576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105bb82610572565b810181811067ffffffffffffffff821117156105da576105d9610583565b5b80604052505050565b60006105ed610554565b90506105f982826105b2565b919050565b600067ffffffffffffffff82111561061957610618610583565b5b61062282610572565b9050602081019050919050565b82818337600083830152505050565b600061065161064c846105fe565b6105e3565b90508281526020810184848401111561066d5761066c61056d565b5b61067884828561062f565b509392505050565b600082601f83011261069557610694610568565b5b81356106a584826020860161063e565b91505092915050565b6000819050919050565b6106c1816106ae565b81146106cc57600080fd5b50565b6000813590506106de816106b8565b92915050565b600080604083850312156106fb576106fa61055e565b5b600083013567ffffffffffffffff81111561071957610718610563565b5b61072585828601610680565b9250506020610736858286016106cf565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076b82610740565b9050919050565b61077b81610760565b811461078657600080fd5b50565b60008135905061079881610772565b92915050565b600080600080608085870312156107b8576107b761055e565b5b60006107c687828801610789565b94505060206107d7878288016106cf565b935050604085013567ffffffffffffffff8111156107f8576107f7610563565b5b61080487828801610680565b9250506060610815878288016106cf565b91505092959194509250565b600061082c82610740565b9050919050565b61083c81610821565b82525050565b61084b816106ae565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561088b578082015181840152602081019050610870565b60008484015250505050565b60006108a282610851565b6108ac818561085c565b93506108bc81856020860161086d565b6108c581610572565b840191505092915050565b60006060820190506108e56000830186610833565b6108f26020830185610842565b81810360408301526109048184610897565b9050949350505050565b60008151905061091d816106b8565b92915050565b6000602082840312156109395761093861055e565b5b60006109478482850161090e565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109b7603f83610950565b91506109c28261095b565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b60006109fe82610851565b610a088185610950565b9350610a1881856020860161086d565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a55826109aa565b9150610a60826109cd565b600b82019150610a7082856109f3565b9150610a7b82610a24565b600982019150610a8b82846109f3565b91508190509392505050565b60006020820190508181036000830152610ab18184610897565b905092915050565b7f4661696c656420746f2073656e64206e617469766520746f6b656e0000000000600082015250565b6000610aef601b8361085c565b9150610afa82610ab9565b602082019050919050565b60006020820190508181036000830152610b1e81610ae2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212200d00fcf0f8c292ec663c93dd26e426953911b9d9cfb7f41829934866e308cbde64736f6c63430008180033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80630a04fd4d1461003b578063a4de557414610057575b600080fd5b610055600480360381019061005091906106e4565b610073565b005b610071600480360381019061006c919061079e565b610195565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016100d4939291906108d0565b6020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610923565b905081811461012582610333565b61012e84610333565b60405160200161013f929190610a4a565b6040516020818303038152906040529061018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869190610a97565b60405180910390fd5b50505050565b60008473ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505090508061020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020590610b05565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685876040518463ffffffff1660e01b815260040161026f939291906108d0565b6020604051808303816000875af115801561028e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b29190610923565b90508281146102c082610333565b6102c985610333565b6040516020016102da929190610a4a565b6040516020818303038152906040529061032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219190610a97565b60405180910390fd5b50505050505050565b60606000600161034284610401565b01905060008167ffffffffffffffff81111561036157610360610583565b5b6040519080825280601f01601f1916602001820160405280156103935781602001600182028036833780820191505090505b509050600082602001820190505b6001156103f6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816103ea576103e9610b25565b5b049450600085036103a1575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061045f577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161045557610454610b25565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061049c576d04ee2d6d415b85acef8100000000838161049257610491610b25565b5b0492506020810190505b662386f26fc1000083106104cb57662386f26fc1000083816104c1576104c0610b25565b5b0492506010810190505b6305f5e10083106104f4576305f5e10083816104ea576104e9610b25565b5b0492506008810190505b612710831061051957612710838161050f5761050e610b25565b5b0492506004810190505b6064831061053c576064838161053257610531610b25565b5b0492506002810190505b600a831061054b576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105bb82610572565b810181811067ffffffffffffffff821117156105da576105d9610583565b5b80604052505050565b60006105ed610554565b90506105f982826105b2565b919050565b600067ffffffffffffffff82111561061957610618610583565b5b61062282610572565b9050602081019050919050565b82818337600083830152505050565b600061065161064c846105fe565b6105e3565b90508281526020810184848401111561066d5761066c61056d565b5b61067884828561062f565b509392505050565b600082601f83011261069557610694610568565b5b81356106a584826020860161063e565b91505092915050565b6000819050919050565b6106c1816106ae565b81146106cc57600080fd5b50565b6000813590506106de816106b8565b92915050565b600080604083850312156106fb576106fa61055e565b5b600083013567ffffffffffffffff81111561071957610718610563565b5b61072585828601610680565b9250506020610736858286016106cf565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076b82610740565b9050919050565b61077b81610760565b811461078657600080fd5b50565b60008135905061079881610772565b92915050565b600080600080608085870312156107b8576107b761055e565b5b60006107c687828801610789565b94505060206107d7878288016106cf565b935050604085013567ffffffffffffffff8111156107f8576107f7610563565b5b61080487828801610680565b9250506060610815878288016106cf565b91505092959194509250565b600061082c82610740565b9050919050565b61083c81610821565b82525050565b61084b816106ae565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561088b578082015181840152602081019050610870565b60008484015250505050565b60006108a282610851565b6108ac818561085c565b93506108bc81856020860161086d565b6108c581610572565b840191505092915050565b60006060820190506108e56000830186610833565b6108f26020830185610842565b81810360408301526109048184610897565b9050949350505050565b60008151905061091d816106b8565b92915050565b6000602082840312156109395761093861055e565b5b60006109478482850161090e565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109b7603f83610950565b91506109c28261095b565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b60006109fe82610851565b610a088185610950565b9350610a1881856020860161086d565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a55826109aa565b9150610a60826109cd565b600b82019150610a7082856109f3565b9150610a7b82610a24565b600982019150610a8b82846109f3565b91508190509392505050565b60006020820190508181036000830152610ab18184610897565b905092915050565b7f4661696c656420746f2073656e64206e617469766520746f6b656e0000000000600082015250565b6000610aef601b8361085c565b9150610afa82610ab9565b602082019050919050565b60006020820190508181036000830152610b1e81610ae2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea26469706673582212200d00fcf0f8c292ec663c93dd26e426953911b9d9cfb7f41829934866e308cbde64736f6c63430008180033", + "bytecode": "0x608060405234801561001057600080fd5b50604051610ca1380380610ca1833981810160405281019061003291906100db565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610108565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a88261007d565b9050919050565b6100b88161009d565b81146100c357600080fd5b50565b6000815190506100d5816100af565b92915050565b6000602082840312156100f1576100f0610078565b5b60006100ff848285016100c6565b91505092915050565b610b8a806101176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80630a04fd4d1461003b578063a4de557414610057575b600080fd5b610055600480360381019061005091906106e4565b610073565b005b610071600480360381019061006c919061079e565b610195565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016100d4939291906108d0565b6020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610923565b905081811461012582610333565b61012e84610333565b60405160200161013f929190610a4a565b6040516020818303038152906040529061018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869190610a97565b60405180910390fd5b50505050565b60008473ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505090508061020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020590610b05565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685876040518463ffffffff1660e01b815260040161026f939291906108d0565b6020604051808303816000875af115801561028e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b29190610923565b90508281146102c082610333565b6102c985610333565b6040516020016102da929190610a4a565b6040516020818303038152906040529061032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219190610a97565b60405180910390fd5b50505050505050565b60606000600161034284610401565b01905060008167ffffffffffffffff81111561036157610360610583565b5b6040519080825280601f01601f1916602001820160405280156103935781602001600182028036833780820191505090505b509050600082602001820190505b6001156103f6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816103ea576103e9610b25565b5b049450600085036103a1575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061045f577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161045557610454610b25565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061049c576d04ee2d6d415b85acef8100000000838161049257610491610b25565b5b0492506020810190505b662386f26fc1000083106104cb57662386f26fc1000083816104c1576104c0610b25565b5b0492506010810190505b6305f5e10083106104f4576305f5e10083816104ea576104e9610b25565b5b0492506008810190505b612710831061051957612710838161050f5761050e610b25565b5b0492506004810190505b6064831061053c576064838161053257610531610b25565b5b0492506002810190505b600a831061054b576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105bb82610572565b810181811067ffffffffffffffff821117156105da576105d9610583565b5b80604052505050565b60006105ed610554565b90506105f982826105b2565b919050565b600067ffffffffffffffff82111561061957610618610583565b5b61062282610572565b9050602081019050919050565b82818337600083830152505050565b600061065161064c846105fe565b6105e3565b90508281526020810184848401111561066d5761066c61056d565b5b61067884828561062f565b509392505050565b600082601f83011261069557610694610568565b5b81356106a584826020860161063e565b91505092915050565b6000819050919050565b6106c1816106ae565b81146106cc57600080fd5b50565b6000813590506106de816106b8565b92915050565b600080604083850312156106fb576106fa61055e565b5b600083013567ffffffffffffffff81111561071957610718610563565b5b61072585828601610680565b9250506020610736858286016106cf565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076b82610740565b9050919050565b61077b81610760565b811461078657600080fd5b50565b60008135905061079881610772565b92915050565b600080600080608085870312156107b8576107b761055e565b5b60006107c687828801610789565b94505060206107d7878288016106cf565b935050604085013567ffffffffffffffff8111156107f8576107f7610563565b5b61080487828801610680565b9250506060610815878288016106cf565b91505092959194509250565b600061082c82610740565b9050919050565b61083c81610821565b82525050565b61084b816106ae565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561088b578082015181840152602081019050610870565b60008484015250505050565b60006108a282610851565b6108ac818561085c565b93506108bc81856020860161086d565b6108c581610572565b840191505092915050565b60006060820190506108e56000830186610833565b6108f26020830185610842565b81810360408301526109048184610897565b9050949350505050565b60008151905061091d816106b8565b92915050565b6000602082840312156109395761093861055e565b5b60006109478482850161090e565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109b7603f83610950565b91506109c28261095b565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b60006109fe82610851565b610a088185610950565b9350610a1881856020860161086d565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a55826109aa565b9150610a60826109cd565b600b82019150610a7082856109f3565b9150610a7b82610a24565b600982019150610a8b82846109f3565b91508190509392505050565b60006020820190508181036000830152610ab18184610897565b905092915050565b7f4661696c656420746f2073656e64206e617469766520746f6b656e0000000000600082015250565b6000610aef601b8361085c565b9150610afa82610ab9565b602082019050919050565b60006020820190508181036000830152610b1e81610ae2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220537a99126d8c145114145f22552a791dfb3e2b30393022b159f7c2e0d8db2aa064736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80630a04fd4d1461003b578063a4de557414610057575b600080fd5b610055600480360381019061005091906106e4565b610073565b005b610071600480360381019061006c919061079e565b610195565b005b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016100d4939291906108d0565b6020604051808303816000875af11580156100f3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101179190610923565b905081811461012582610333565b61012e84610333565b60405160200161013f929190610a4a565b6040516020818303038152906040529061018f576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101869190610a97565b60405180910390fd5b50505050565b60008473ffffffffffffffffffffffffffffffffffffffff166108fc859081150290604051600060405180830381858888f1935050505090508061020e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161020590610b05565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1685876040518463ffffffff1660e01b815260040161026f939291906108d0565b6020604051808303816000875af115801561028e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102b29190610923565b90508281146102c082610333565b6102c985610333565b6040516020016102da929190610a4a565b6040516020818303038152906040529061032a576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103219190610a97565b60405180910390fd5b50505050505050565b60606000600161034284610401565b01905060008167ffffffffffffffff81111561036157610360610583565b5b6040519080825280601f01601f1916602001820160405280156103935781602001600182028036833780820191505090505b509050600082602001820190505b6001156103f6578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a85816103ea576103e9610b25565b5b049450600085036103a1575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000831061045f577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161045557610454610b25565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061049c576d04ee2d6d415b85acef8100000000838161049257610491610b25565b5b0492506020810190505b662386f26fc1000083106104cb57662386f26fc1000083816104c1576104c0610b25565b5b0492506010810190505b6305f5e10083106104f4576305f5e10083816104ea576104e9610b25565b5b0492506008810190505b612710831061051957612710838161050f5761050e610b25565b5b0492506004810190505b6064831061053c576064838161053257610531610b25565b5b0492506002810190505b600a831061054b576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105bb82610572565b810181811067ffffffffffffffff821117156105da576105d9610583565b5b80604052505050565b60006105ed610554565b90506105f982826105b2565b919050565b600067ffffffffffffffff82111561061957610618610583565b5b61062282610572565b9050602081019050919050565b82818337600083830152505050565b600061065161064c846105fe565b6105e3565b90508281526020810184848401111561066d5761066c61056d565b5b61067884828561062f565b509392505050565b600082601f83011261069557610694610568565b5b81356106a584826020860161063e565b91505092915050565b6000819050919050565b6106c1816106ae565b81146106cc57600080fd5b50565b6000813590506106de816106b8565b92915050565b600080604083850312156106fb576106fa61055e565b5b600083013567ffffffffffffffff81111561071957610718610563565b5b61072585828601610680565b9250506020610736858286016106cf565b9150509250929050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061076b82610740565b9050919050565b61077b81610760565b811461078657600080fd5b50565b60008135905061079881610772565b92915050565b600080600080608085870312156107b8576107b761055e565b5b60006107c687828801610789565b94505060206107d7878288016106cf565b935050604085013567ffffffffffffffff8111156107f8576107f7610563565b5b61080487828801610680565b9250506060610815878288016106cf565b91505092959194509250565b600061082c82610740565b9050919050565b61083c81610821565b82525050565b61084b816106ae565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561088b578082015181840152602081019050610870565b60008484015250505050565b60006108a282610851565b6108ac818561085c565b93506108bc81856020860161086d565b6108c581610572565b840191505092915050565b60006060820190506108e56000830186610833565b6108f26020830185610842565b81810360408301526109048184610897565b9050949350505050565b60008151905061091d816106b8565b92915050565b6000602082840312156109395761093861055e565b5b60006109478482850161090e565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b60006109b7603f83610950565b91506109c28261095b565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b60006109fe82610851565b610a088185610950565b9350610a1881856020860161086d565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b6000610a55826109aa565b9150610a60826109cd565b600b82019150610a7082856109f3565b9150610a7b82610a24565b600982019150610a8b82846109f3565b91508190509392505050565b60006020820190508181036000830152610ab18184610897565b905092915050565b7f4661696c656420746f2073656e64206e617469766520746f6b656e0000000000600082015250565b6000610aef601b8361085c565b9150610afa82610ab9565b602082019050919050565b60006020820190508181036000830152610b1e81610ae2565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea2646970667358221220537a99126d8c145114145f22552a791dfb3e2b30393022b159f7c2e0d8db2aa064736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/evm/embeds/artifacts/contracts/TestPrecompileSelfCallRevert.sol/TestPrecompileSelfCallRevert.json b/x/evm/embeds/artifacts/contracts/TestPrecompileSelfCallRevert.sol/TestPrecompileSelfCallRevert.json index 9f6f671d8..d71d6dfa1 100644 --- a/x/evm/embeds/artifacts/contracts/TestPrecompileSelfCallRevert.sol/TestPrecompileSelfCallRevert.json +++ b/x/evm/embeds/artifacts/contracts/TestPrecompileSelfCallRevert.sol/TestPrecompileSelfCallRevert.json @@ -71,8 +71,8 @@ "type": "function" } ], - "bytecode": "0x60806040526000600155604051610c8e380380610c8e833981810160405281019061002a91906100d3565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610100565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a082610075565b9050919050565b6100b081610095565b81146100bb57600080fd5b50565b6000815190506100cd816100a7565b92915050565b6000602082840312156100e9576100e8610070565b5b60006100f7848285016100be565b91505092915050565b610b7f8061010f6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80636ad4fe961461003b578063705964db14610057575b600080fd5b610055600480360381019061005091906106c1565b610073565b005b610071600480360381019061006c91906106c1565b610208565b005b8373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050506100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906107a1565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016101489392919061085f565b6020604051808303816000875af1158015610167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018b91906108b2565b9050818114610199856102b2565b6101a2846102b2565b6040516020016101b39291906109d9565b60405160208183030381529060405290610203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fa9190610a26565b60405180910390fd5b600080fd5b6001600081548092919061021b90610a77565b91905055503073ffffffffffffffffffffffffffffffffffffffff16636ad4fe96858585856040518563ffffffff1660e01b815260040161025f9493929190610ace565b600060405180830381600087803b15801561027957600080fd5b505af192505050801561028a575060015b6102ab57600160008154809291906102a190610a77565b91905055506102ac565b5b50505050565b6060600060016102c184610380565b01905060008167ffffffffffffffff8111156102e0576102df610596565b5b6040519080825280601f01601f1916602001820160405280156103125781602001600182028036833780820191505090505b509050600082602001820190505b600115610375578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161036957610368610b1a565b5b04945060008503610320575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103de577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103d4576103d3610b1a565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061041b576d04ee2d6d415b85acef8100000000838161041157610410610b1a565b5b0492506020810190505b662386f26fc10000831061044a57662386f26fc1000083816104405761043f610b1a565b5b0492506010810190505b6305f5e1008310610473576305f5e100838161046957610468610b1a565b5b0492506008810190505b612710831061049857612710838161048e5761048d610b1a565b5b0492506004810190505b606483106104bb57606483816104b1576104b0610b1a565b5b0492506002810190505b600a83106104ca576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610512826104e7565b9050919050565b61052281610507565b811461052d57600080fd5b50565b60008135905061053f81610519565b92915050565b6000819050919050565b61055881610545565b811461056357600080fd5b50565b6000813590506105758161054f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105ce82610585565b810181811067ffffffffffffffff821117156105ed576105ec610596565b5b80604052505050565b60006106006104d3565b905061060c82826105c5565b919050565b600067ffffffffffffffff82111561062c5761062b610596565b5b61063582610585565b9050602081019050919050565b82818337600083830152505050565b600061066461065f84610611565b6105f6565b9050828152602081018484840111156106805761067f610580565b5b61068b848285610642565b509392505050565b600082601f8301126106a8576106a761057b565b5b81356106b8848260208601610651565b91505092915050565b600080600080608085870312156106db576106da6104dd565b5b60006106e987828801610530565b94505060206106fa87828801610566565b935050604085013567ffffffffffffffff81111561071b5761071a6104e2565b5b61072787828801610693565b925050606061073887828801610566565b91505092959194509250565b600082825260208201905092915050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b600061078b601383610744565b915061079682610755565b602082019050919050565b600060208201905081810360008301526107ba8161077e565b9050919050565b60006107cc826104e7565b9050919050565b6107dc816107c1565b82525050565b6107eb81610545565b82525050565b600081519050919050565b60005b8381101561081a5780820151818401526020810190506107ff565b60008484015250505050565b6000610831826107f1565b61083b8185610744565b935061084b8185602086016107fc565b61085481610585565b840191505092915050565b600060608201905061087460008301866107d3565b61088160208301856107e2565b81810360408301526108938184610826565b9050949350505050565b6000815190506108ac8161054f565b92915050565b6000602082840312156108c8576108c76104dd565b5b60006108d68482850161089d565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b6000610946603f836108df565b9150610951826108ea565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061098d826107f1565b61099781856108df565b93506109a78185602086016107fc565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b60006109e482610939565b91506109ef8261095c565b600b820191506109ff8285610982565b9150610a0a826109b3565b600982019150610a1a8284610982565b91508190509392505050565b60006020820190508181036000830152610a408184610826565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a8282610545565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ab457610ab3610a48565b5b600182019050919050565b610ac881610507565b82525050565b6000608082019050610ae36000830187610abf565b610af060208301866107e2565b8181036040830152610b028185610826565b9050610b1160608301846107e2565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122025f19b0c686ff339bb4b68de727beee11bc2a0c2b9709bd82cc14c13e1eadbe064736f6c63430008180033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80636ad4fe961461003b578063705964db14610057575b600080fd5b610055600480360381019061005091906106c1565b610073565b005b610071600480360381019061006c91906106c1565b610208565b005b8373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050506100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906107a1565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016101489392919061085f565b6020604051808303816000875af1158015610167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018b91906108b2565b9050818114610199856102b2565b6101a2846102b2565b6040516020016101b39291906109d9565b60405160208183030381529060405290610203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fa9190610a26565b60405180910390fd5b600080fd5b6001600081548092919061021b90610a77565b91905055503073ffffffffffffffffffffffffffffffffffffffff16636ad4fe96858585856040518563ffffffff1660e01b815260040161025f9493929190610ace565b600060405180830381600087803b15801561027957600080fd5b505af192505050801561028a575060015b6102ab57600160008154809291906102a190610a77565b91905055506102ac565b5b50505050565b6060600060016102c184610380565b01905060008167ffffffffffffffff8111156102e0576102df610596565b5b6040519080825280601f01601f1916602001820160405280156103125781602001600182028036833780820191505090505b509050600082602001820190505b600115610375578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161036957610368610b1a565b5b04945060008503610320575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103de577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103d4576103d3610b1a565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061041b576d04ee2d6d415b85acef8100000000838161041157610410610b1a565b5b0492506020810190505b662386f26fc10000831061044a57662386f26fc1000083816104405761043f610b1a565b5b0492506010810190505b6305f5e1008310610473576305f5e100838161046957610468610b1a565b5b0492506008810190505b612710831061049857612710838161048e5761048d610b1a565b5b0492506004810190505b606483106104bb57606483816104b1576104b0610b1a565b5b0492506002810190505b600a83106104ca576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610512826104e7565b9050919050565b61052281610507565b811461052d57600080fd5b50565b60008135905061053f81610519565b92915050565b6000819050919050565b61055881610545565b811461056357600080fd5b50565b6000813590506105758161054f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105ce82610585565b810181811067ffffffffffffffff821117156105ed576105ec610596565b5b80604052505050565b60006106006104d3565b905061060c82826105c5565b919050565b600067ffffffffffffffff82111561062c5761062b610596565b5b61063582610585565b9050602081019050919050565b82818337600083830152505050565b600061066461065f84610611565b6105f6565b9050828152602081018484840111156106805761067f610580565b5b61068b848285610642565b509392505050565b600082601f8301126106a8576106a761057b565b5b81356106b8848260208601610651565b91505092915050565b600080600080608085870312156106db576106da6104dd565b5b60006106e987828801610530565b94505060206106fa87828801610566565b935050604085013567ffffffffffffffff81111561071b5761071a6104e2565b5b61072787828801610693565b925050606061073887828801610566565b91505092959194509250565b600082825260208201905092915050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b600061078b601383610744565b915061079682610755565b602082019050919050565b600060208201905081810360008301526107ba8161077e565b9050919050565b60006107cc826104e7565b9050919050565b6107dc816107c1565b82525050565b6107eb81610545565b82525050565b600081519050919050565b60005b8381101561081a5780820151818401526020810190506107ff565b60008484015250505050565b6000610831826107f1565b61083b8185610744565b935061084b8185602086016107fc565b61085481610585565b840191505092915050565b600060608201905061087460008301866107d3565b61088160208301856107e2565b81810360408301526108938184610826565b9050949350505050565b6000815190506108ac8161054f565b92915050565b6000602082840312156108c8576108c76104dd565b5b60006108d68482850161089d565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b6000610946603f836108df565b9150610951826108ea565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061098d826107f1565b61099781856108df565b93506109a78185602086016107fc565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b60006109e482610939565b91506109ef8261095c565b600b820191506109ff8285610982565b9150610a0a826109b3565b600982019150610a1a8284610982565b91508190509392505050565b60006020820190508181036000830152610a408184610826565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a8282610545565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ab457610ab3610a48565b5b600182019050919050565b610ac881610507565b82525050565b6000608082019050610ae36000830187610abf565b610af060208301866107e2565b8181036040830152610b028185610826565b9050610b1160608301846107e2565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122025f19b0c686ff339bb4b68de727beee11bc2a0c2b9709bd82cc14c13e1eadbe064736f6c63430008180033", + "bytecode": "0x60806040526000600155604051610c8e380380610c8e833981810160405281019061002a91906100d3565b806000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050610100565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100a082610075565b9050919050565b6100b081610095565b81146100bb57600080fd5b50565b6000815190506100cd816100a7565b92915050565b6000602082840312156100e9576100e8610070565b5b60006100f7848285016100be565b91505092915050565b610b7f8061010f6000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c80636ad4fe961461003b578063705964db14610057575b600080fd5b610055600480360381019061005091906106c1565b610073565b005b610071600480360381019061006c91906106c1565b610208565b005b8373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050506100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906107a1565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016101489392919061085f565b6020604051808303816000875af1158015610167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018b91906108b2565b9050818114610199856102b2565b6101a2846102b2565b6040516020016101b39291906109d9565b60405160208183030381529060405290610203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fa9190610a26565b60405180910390fd5b600080fd5b6001600081548092919061021b90610a77565b91905055503073ffffffffffffffffffffffffffffffffffffffff16636ad4fe96858585856040518563ffffffff1660e01b815260040161025f9493929190610ace565b600060405180830381600087803b15801561027957600080fd5b505af192505050801561028a575060015b6102ab57600160008154809291906102a190610a77565b91905055506102ac565b5b50505050565b6060600060016102c184610380565b01905060008167ffffffffffffffff8111156102e0576102df610596565b5b6040519080825280601f01601f1916602001820160405280156103125781602001600182028036833780820191505090505b509050600082602001820190505b600115610375578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161036957610368610b1a565b5b04945060008503610320575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103de577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103d4576103d3610b1a565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061041b576d04ee2d6d415b85acef8100000000838161041157610410610b1a565b5b0492506020810190505b662386f26fc10000831061044a57662386f26fc1000083816104405761043f610b1a565b5b0492506010810190505b6305f5e1008310610473576305f5e100838161046957610468610b1a565b5b0492506008810190505b612710831061049857612710838161048e5761048d610b1a565b5b0492506004810190505b606483106104bb57606483816104b1576104b0610b1a565b5b0492506002810190505b600a83106104ca576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610512826104e7565b9050919050565b61052281610507565b811461052d57600080fd5b50565b60008135905061053f81610519565b92915050565b6000819050919050565b61055881610545565b811461056357600080fd5b50565b6000813590506105758161054f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105ce82610585565b810181811067ffffffffffffffff821117156105ed576105ec610596565b5b80604052505050565b60006106006104d3565b905061060c82826105c5565b919050565b600067ffffffffffffffff82111561062c5761062b610596565b5b61063582610585565b9050602081019050919050565b82818337600083830152505050565b600061066461065f84610611565b6105f6565b9050828152602081018484840111156106805761067f610580565b5b61068b848285610642565b509392505050565b600082601f8301126106a8576106a761057b565b5b81356106b8848260208601610651565b91505092915050565b600080600080608085870312156106db576106da6104dd565b5b60006106e987828801610530565b94505060206106fa87828801610566565b935050604085013567ffffffffffffffff81111561071b5761071a6104e2565b5b61072787828801610693565b925050606061073887828801610566565b91505092959194509250565b600082825260208201905092915050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b600061078b601383610744565b915061079682610755565b602082019050919050565b600060208201905081810360008301526107ba8161077e565b9050919050565b60006107cc826104e7565b9050919050565b6107dc816107c1565b82525050565b6107eb81610545565b82525050565b600081519050919050565b60005b8381101561081a5780820151818401526020810190506107ff565b60008484015250505050565b6000610831826107f1565b61083b8185610744565b935061084b8185602086016107fc565b61085481610585565b840191505092915050565b600060608201905061087460008301866107d3565b61088160208301856107e2565b81810360408301526108938184610826565b9050949350505050565b6000815190506108ac8161054f565b92915050565b6000602082840312156108c8576108c76104dd565b5b60006108d68482850161089d565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b6000610946603f836108df565b9150610951826108ea565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061098d826107f1565b61099781856108df565b93506109a78185602086016107fc565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b60006109e482610939565b91506109ef8261095c565b600b820191506109ff8285610982565b9150610a0a826109b3565b600982019150610a1a8284610982565b91508190509392505050565b60006020820190508181036000830152610a408184610826565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a8282610545565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ab457610ab3610a48565b5b600182019050919050565b610ac881610507565b82525050565b6000608082019050610ae36000830187610abf565b610af060208301866107e2565b8181036040830152610b028185610826565b9050610b1160608301846107e2565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122005e9d030e05589bcbd7f2b8c2c7891d3ff3059be6d273b8aa94f18f14212d30964736f6c63430008180033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c80636ad4fe961461003b578063705964db14610057575b600080fd5b610055600480360381019061005091906106c1565b610073565b005b610071600480360381019061006c91906106c1565b610208565b005b8373ffffffffffffffffffffffffffffffffffffffff166108fc849081150290604051600060405180830381858888f193505050506100e7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016100de906107a1565b60405180910390fd5b600061080073ffffffffffffffffffffffffffffffffffffffff1663e77a47bf60008054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684866040518463ffffffff1660e01b81526004016101489392919061085f565b6020604051808303816000875af1158015610167573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061018b91906108b2565b9050818114610199856102b2565b6101a2846102b2565b6040516020016101b39291906109d9565b60405160208183030381529060405290610203576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016101fa9190610a26565b60405180910390fd5b600080fd5b6001600081548092919061021b90610a77565b91905055503073ffffffffffffffffffffffffffffffffffffffff16636ad4fe96858585856040518563ffffffff1660e01b815260040161025f9493929190610ace565b600060405180830381600087803b15801561027957600080fd5b505af192505050801561028a575060015b6102ab57600160008154809291906102a190610a77565b91905055506102ac565b5b50505050565b6060600060016102c184610380565b01905060008167ffffffffffffffff8111156102e0576102df610596565b5b6040519080825280601f01601f1916602001820160405280156103125781602001600182028036833780820191505090505b509050600082602001820190505b600115610375578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a858161036957610368610b1a565b5b04945060008503610320575b819350505050919050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083106103de577a184f03e93ff9f4daa797ed6e38ed64bf6a1f01000000000000000083816103d4576103d3610b1a565b5b0492506040810190505b6d04ee2d6d415b85acef8100000000831061041b576d04ee2d6d415b85acef8100000000838161041157610410610b1a565b5b0492506020810190505b662386f26fc10000831061044a57662386f26fc1000083816104405761043f610b1a565b5b0492506010810190505b6305f5e1008310610473576305f5e100838161046957610468610b1a565b5b0492506008810190505b612710831061049857612710838161048e5761048d610b1a565b5b0492506004810190505b606483106104bb57606483816104b1576104b0610b1a565b5b0492506002810190505b600a83106104ca576001810190505b80915050919050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610512826104e7565b9050919050565b61052281610507565b811461052d57600080fd5b50565b60008135905061053f81610519565b92915050565b6000819050919050565b61055881610545565b811461056357600080fd5b50565b6000813590506105758161054f565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6105ce82610585565b810181811067ffffffffffffffff821117156105ed576105ec610596565b5b80604052505050565b60006106006104d3565b905061060c82826105c5565b919050565b600067ffffffffffffffff82111561062c5761062b610596565b5b61063582610585565b9050602081019050919050565b82818337600083830152505050565b600061066461065f84610611565b6105f6565b9050828152602081018484840111156106805761067f610580565b5b61068b848285610642565b509392505050565b600082601f8301126106a8576106a761057b565b5b81356106b8848260208601610651565b91505092915050565b600080600080608085870312156106db576106da6104dd565b5b60006106e987828801610530565b94505060206106fa87828801610566565b935050604085013567ffffffffffffffff81111561071b5761071a6104e2565b5b61072787828801610693565b925050606061073887828801610566565b91505092959194509250565b600082825260208201905092915050565b7f455448207472616e73666572206661696c656400000000000000000000000000600082015250565b600061078b601383610744565b915061079682610755565b602082019050919050565b600060208201905081810360008301526107ba8161077e565b9050919050565b60006107cc826104e7565b9050919050565b6107dc816107c1565b82525050565b6107eb81610545565b82525050565b600081519050919050565b60005b8381101561081a5780820151818401526020810190506107ff565b60008484015250505050565b6000610831826107f1565b61083b8185610744565b935061084b8185602086016107fc565b61085481610585565b840191505092915050565b600060608201905061087460008301866107d3565b61088160208301856107e2565b81810360408301526108938184610826565b9050949350505050565b6000815190506108ac8161054f565b92915050565b6000602082840312156108c8576108c76104dd565b5b60006108d68482850161089d565b91505092915050565b600081905092915050565b7f4946756e546f6b656e2e73656e64546f42616e6b20737563636565646564206260008201527f7574207472616e73666572726564207468652077726f6e6720616d6f756e7400602082015250565b6000610946603f836108df565b9150610951826108ea565b603f82019050919050565b7f73656e74416d6f756e7420000000000000000000000000000000000000000000815250565b600061098d826107f1565b61099781856108df565b93506109a78185602086016107fc565b80840191505092915050565b7f6578706563746564200000000000000000000000000000000000000000000000815250565b60006109e482610939565b91506109ef8261095c565b600b820191506109ff8285610982565b9150610a0a826109b3565b600982019150610a1a8284610982565b91508190509392505050565b60006020820190508181036000830152610a408184610826565b905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610a8282610545565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203610ab457610ab3610a48565b5b600182019050919050565b610ac881610507565b82525050565b6000608082019050610ae36000830187610abf565b610af060208301866107e2565b8181036040830152610b028185610826565b9050610b1160608301846107e2565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fdfea264697066735822122005e9d030e05589bcbd7f2b8c2c7891d3ff3059be6d273b8aa94f18f14212d30964736f6c63430008180033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/x/evm/embeds/artifacts/contracts/Wasm.sol/IWasm.json b/x/evm/embeds/artifacts/contracts/Wasm.sol/IWasm.json index 61e38453f..a005bfcbb 100644 --- a/x/evm/embeds/artifacts/contracts/Wasm.sol/IWasm.json +++ b/x/evm/embeds/artifacts/contracts/Wasm.sol/IWasm.json @@ -3,6 +3,25 @@ "contractName": "IWasm", "sourceName": "contracts/Wasm.sol", "abi": [ + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "string", + "name": "eventType", + "type": "string" + }, + { + "indexed": false, + "internalType": "string", + "name": "abciEvent", + "type": "string" + } + ], + "name": "AbciEvent", + "type": "event" + }, { "inputs": [ { @@ -28,7 +47,7 @@ "type": "uint256" } ], - "internalType": "struct IWasm.BankCoin[]", + "internalType": "struct INibiruEvm.BankCoin[]", "name": "funds", "type": "tuple[]" } @@ -71,7 +90,7 @@ "type": "uint256" } ], - "internalType": "struct IWasm.BankCoin[]", + "internalType": "struct INibiruEvm.BankCoin[]", "name": "funds", "type": "tuple[]" } @@ -127,7 +146,7 @@ "type": "uint256" } ], - "internalType": "struct IWasm.BankCoin[]", + "internalType": "struct INibiruEvm.BankCoin[]", "name": "funds", "type": "tuple[]" } diff --git a/x/evm/embeds/contracts/IFunToken.sol b/x/evm/embeds/contracts/IFunToken.sol index 70b130638..7a943ef98 100644 --- a/x/evm/embeds/contracts/IFunToken.sol +++ b/x/evm/embeds/contracts/IFunToken.sol @@ -4,10 +4,12 @@ pragma solidity >=0.8.19; address constant FUNTOKEN_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000800; IFunToken constant FUNTOKEN_PRECOMPILE = IFunToken(FUNTOKEN_PRECOMPILE_ADDRESS); +import "./NibiruEvmUtils.sol"; + /// @dev Implements the functionality for sending ERC20 tokens and bank /// coins to various Nibiru accounts using either the Nibiru Bech32 address /// using the "FunToken" mapping between the ERC20 and bank. -interface IFunToken { +interface IFunToken is INibiruEvm { /// @dev sendToBank sends ERC20 tokens as coins to a Nibiru base account /// @param erc20 - the address of the ERC20 token contract /// @param amount - the amount of tokens to send diff --git a/x/evm/embeds/contracts/NibiruEvmUtils.sol b/x/evm/embeds/contracts/NibiruEvmUtils.sol new file mode 100644 index 000000000..6a3a5b524 --- /dev/null +++ b/x/evm/embeds/contracts/NibiruEvmUtils.sol @@ -0,0 +1,24 @@ +// SPDX-License-Identifier: MIT +pragma solidity >=0.8.19; + +/// @notice Interface defining the AbciEvent for interoperability between +/// Ethereum and the ABCI (Application Blockchain Interface). +interface INibiruEvm { + struct BankCoin { + string denom; + uint256 amount; + } + + /// @notice Event emitted to in precompiled contracts to relay information + /// from the ABCI to the EVM logs and indexers. Consumers of this event should + /// decode the `attrs` parameter based on the `eventType` context. + /// + /// @param eventType An identifier type of the event, used for indexing. + /// Event types indexable with CometBFT indexer are in snake case like + /// "pending_ethereum_tx" or "message", while protobuf typed events use the + /// proto message name as their event type (e.g. + /// "eth.evm.v1.EventEthereumTx"). + /// @param abciEvent JSON object string with the event type and fields of an + /// ABCI event. + event AbciEvent(string indexed eventType, string abciEvent); +} diff --git a/x/evm/embeds/contracts/Wasm.sol b/x/evm/embeds/contracts/Wasm.sol index 8a5842062..37ea785df 100644 --- a/x/evm/embeds/contracts/Wasm.sol +++ b/x/evm/embeds/contracts/Wasm.sol @@ -5,69 +5,65 @@ address constant WASM_PRECOMPILE_ADDRESS = 0x00000000000000000000000000000000000 IWasm constant WASM_PRECOMPILE = IWasm(WASM_PRECOMPILE_ADDRESS); -interface IWasm { - struct BankCoin { - string denom; - uint256 amount; - } +import "./NibiruEvmUtils.sol"; - /// @notice Invoke a contract's "ExecuteMsg", which corresponds to - /// "wasm/types/MsgExecuteContract". This enables arbitrary smart contract - /// execution using the Wasm VM from the EVM. - /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract - /// @param msgArgs JSON encoded wasm execute invocation - /// @param funds Optional funds to supply during the execute call. It's - /// uncommon to use this field, so you'll pass an empty array most of the time. - /// @dev The three non-struct arguments are more gas efficient than encoding a - /// single argument as a WasmExecuteMsg. - function execute( - string memory contractAddr, - bytes memory msgArgs, - BankCoin[] memory funds - ) payable external returns (bytes memory response); +interface IWasm is INibiruEvm { + /// @notice Invoke a contract's "ExecuteMsg", which corresponds to + /// "wasm/types/MsgExecuteContract". This enables arbitrary smart contract + /// execution using the Wasm VM from the EVM. + /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract + /// @param msgArgs JSON encoded wasm execute invocation + /// @param funds Optional funds to supply during the execute call. It's + /// uncommon to use this field, so you'll pass an empty array most of the time. + /// @dev The three non-struct arguments are more gas efficient than encoding a + /// single argument as a WasmExecuteMsg. + function execute( + string memory contractAddr, + bytes memory msgArgs, + INibiruEvm.BankCoin[] memory funds + ) external payable returns (bytes memory response); - struct WasmExecuteMsg { - string contractAddr; - bytes msgArgs; - BankCoin[] funds; - } + struct WasmExecuteMsg { + string contractAddr; + bytes msgArgs; + INibiruEvm.BankCoin[] funds; + } - /// @notice Identical to "execute", except for multiple contract calls. - function executeMulti( - WasmExecuteMsg[] memory executeMsgs - ) payable external returns (bytes[] memory responses); + /// @notice Identical to "execute", except for multiple contract calls. + function executeMulti( + WasmExecuteMsg[] memory executeMsgs + ) external payable returns (bytes[] memory responses); - /// @notice Query the public API of another contract at a known address (with - /// known ABI). - /// Implements smart query, the "WasmQuery::Smart" variant from "cosmwas_std". - /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract - /// @param req JSON encoded query request - /// @return response Returns whatever type the contract returns (caller should - /// know), wrapped in a JSON encoded contract result. - function query( - string memory contractAddr, - bytes memory req - ) external view returns (bytes memory response); + /// @notice Query the public API of another contract at a known address (with + /// known ABI). + /// Implements smart query, the "WasmQuery::Smart" variant from "cosmwas_std". + /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract + /// @param req JSON encoded query request + /// @return response Returns whatever type the contract returns (caller should + /// know), wrapped in a JSON encoded contract result. + function query( + string memory contractAddr, + bytes memory req + ) external view returns (bytes memory response); - /// @notice Query the raw kv-store of the contract. - /// Implements raw query, the "WasmQuery::Raw" variant from "cosmwas_std". - /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract - /// @param key contract state key. For example, a `cw_storage_plus::Item` of - /// value `Item::new("state")` creates prefix store with key, "state". - /// @return response JSON encoded, raw data stored at that key. - function queryRaw( - string memory contractAddr, - bytes memory key - ) external view returns (bytes memory response); - - /// @notice InstantiateContract creates a new smart contract instance for the - /// given code id. - function instantiate( - string memory admin, - uint64 codeID, - bytes memory msgArgs, - string memory label, - BankCoin[] memory funds - ) payable external returns (string memory contractAddr, bytes memory data); + /// @notice Query the raw kv-store of the contract. + /// Implements raw query, the "WasmQuery::Raw" variant from "cosmwas_std". + /// @param contractAddr nibi-prefixed Bech32 address of the wasm contract + /// @param key contract state key. For example, a `cw_storage_plus::Item` of + /// value `Item::new("state")` creates prefix store with key, "state". + /// @return response JSON encoded, raw data stored at that key. + function queryRaw( + string memory contractAddr, + bytes memory key + ) external view returns (bytes memory response); + /// @notice InstantiateContract creates a new smart contract instance for the + /// given code id. + function instantiate( + string memory admin, + uint64 codeID, + bytes memory msgArgs, + string memory label, + INibiruEvm.BankCoin[] memory funds + ) external payable returns (string memory contractAddr, bytes memory data); } diff --git a/x/evm/precompile/funtoken.go b/x/evm/precompile/funtoken.go index a987440c1..272d96b18 100644 --- a/x/evm/precompile/funtoken.go +++ b/x/evm/precompile/funtoken.go @@ -60,6 +60,8 @@ func (p precompileFunToken) Run( // Gracefully handles "out of gas" defer HandleOutOfGasPanic(&err)() + abciEventsStartIdx := len(startResult.CacheCtx.EventManager().Events()) + method := startResult.Method switch PrecompileMethod(method.Name) { case FunTokenMethod_sendToBank: @@ -80,6 +82,17 @@ func (p precompileFunToken) Run( return nil, err } + // Emit extra events for the EVM if this is a transaction + // https://github.com/NibiruChain/nibiru/issues/2121 + if isMutation[PrecompileMethod(startResult.Method.Name)] { + EmitEventAbciEvents( + startResult.CacheCtx, + startResult.StateDB, + startResult.CacheCtx.EventManager().Events()[abciEventsStartIdx:], + p.Address(), + ) + } + // Gas consumed by a local gas meter contract.UseGas(startResult.CacheCtx.GasMeter().GasConsumed()) return bz, err diff --git a/x/evm/precompile/funtoken_test.go b/x/evm/precompile/funtoken_test.go index 7645a26e5..0e03f2870 100644 --- a/x/evm/precompile/funtoken_test.go +++ b/x/evm/precompile/funtoken_test.go @@ -5,6 +5,7 @@ import ( "math/big" "testing" + sdkmath "cosmossdk.io/math" sdk "github.com/cosmos/cosmos-sdk/types" gethcommon "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/suite" @@ -21,6 +22,7 @@ import ( // TestSuite: Runs all the tests in the suite. func TestSuite(t *testing.T) { + suite.Run(t, new(UtilsSuite)) suite.Run(t, new(FuntokenSuite)) suite.Run(t, new(WasmSuite)) } @@ -223,6 +225,10 @@ func (s *FuntokenSuite) TestHappyPath() { s.NoError(err) deps.ResetGasMeter() + err = testapp.FundFeeCollector(deps.App.BankKeeper, deps.Ctx, + sdkmath.NewInt(70_000), + ) + s.NoError(err) _, ethTxResp, err := evmtest.CallContractTx( &deps, precompile.PrecompileAddr_FunToken, diff --git a/x/evm/precompile/nibiru_evm_utils.go b/x/evm/precompile/nibiru_evm_utils.go new file mode 100644 index 000000000..08805481f --- /dev/null +++ b/x/evm/precompile/nibiru_evm_utils.go @@ -0,0 +1,108 @@ +package precompile + +import ( + "bytes" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + gethcommon "github.com/ethereum/go-ethereum/common" + gethcore "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" + + "github.com/NibiruChain/nibiru/v2/x/common/set" + "github.com/NibiruChain/nibiru/v2/x/evm/embeds" + "github.com/NibiruChain/nibiru/v2/x/evm/statedb" +) + +// EvmEventAbciEvent is the string key used to retrieve the "AbciEvent" Ethereum +// ABI event for a precompiled contract that implements the "INibiruEvm" +// interface from "Nibiru/x/evm/embeds/contracts/NibiruEvmUtils.sol". +const EvmEventAbciEvent = "AbciEvent" + +// EmitEventAbciEvents adds a sequence of ABCI events to the EVM state DB so that +// they can be emitted at the end of the "EthereumTx". These events are indexed +// by their ABCI event type and help communicate non-EVM events in Ethereum-based +// block explorers and indexers by saving the event attributes in JSON form. +// +// Instead of ABI packing the non-indexed argument, this function encodes the +// [gethcore.Log].Data as a JSON string directly to optimize readbility in +// explorers without requiring the reader to decode using an ABI. +// +// Simply use ["encoding/hex".DecodeString] with the "0x" prefix removed to read +// the ABCI event. +func EmitEventAbciEvents( + ctx sdk.Context, + db *statedb.StateDB, + abciEvents []sdk.Event, + emittingAddr gethcommon.Address, +) { + blockNumber := uint64(ctx.BlockHeight()) + event := embeds.SmartContract_Wasm.ABI.Events[EvmEventAbciEvent] + for _, abciEvent := range abciEvents { + // Why 2 topics? Because 2 = event ID + number of indexed event fields + topics := make([]gethcommon.Hash, 2) + topics[0] = event.ID + + // eventType is the first (and only) indexed field + topics[1] = EventTopicFromString(abciEvent.Type) + + attrsBz := AttrsToJSON(append([]abci.EventAttribute{ + {Key: "eventType", Value: abciEvent.Type}, + }, abciEvent.Attributes...)) + nonIndexedArgs, _ := event.Inputs.NonIndexed().Pack(string(attrsBz)) + db.AddLog(&gethcore.Log{ + Address: emittingAddr, + Topics: topics, + Data: nonIndexedArgs, + BlockNumber: blockNumber, + }) + } +} + +// AttrsToJSON creates a deterministic JSON encoding for the key-value tuples. +func AttrsToJSON(attrs []abci.EventAttribute) []byte { + if len(attrs) == 0 { + return []byte("") + } + keysSeen := set.New[string]() + + // Create JSON object from the key-value tuples + var buf bytes.Buffer + buf.WriteByte('{') + for i, attr := range attrs { + // Keys must be unique to guarantee valid JSON object + if keysSeen.Has(attr.Key) { + continue + } + keysSeen.Add(attr.Key) + + if i > 0 { + buf.WriteByte(',') + } + + // Quote key and value + _, _ = fmt.Fprintf(&buf, `"%s":"%s"`, attr.Key, attr.Value) + } + buf.WriteByte('}') + + return buf.Bytes() +} + +// EventTopicFromBytes creates a "Topic" hash for an EVM event log. +// An event topic is a 32-byte field used to index specific fields in a smart +// contract event. Topics make it possible to efficiently filter for and search +// events in transaction logs. +func EventTopicFromBytes(bz []byte) (topic gethcommon.Hash) { + hash := crypto.Keccak256Hash(bz) + copy(topic[:], hash[:]) + return topic +} + +// EventTopicFromString creates a "Topic" hash for an EVM event log. +// An event topic is a 32-byte field used to index specific fields in a smart +// contract event. Topics make it possible to efficiently filter for and search +// events in transaction logs. +func EventTopicFromString(str string) (topic gethcommon.Hash) { + return EventTopicFromBytes([]byte(str)) +} diff --git a/x/evm/precompile/nibiru_evm_utils_test.go b/x/evm/precompile/nibiru_evm_utils_test.go new file mode 100644 index 000000000..33348f281 --- /dev/null +++ b/x/evm/precompile/nibiru_evm_utils_test.go @@ -0,0 +1,169 @@ +package precompile_test + +import ( + "encoding/json" + "fmt" + + abci "github.com/cometbft/cometbft/abci/types" + sdk "github.com/cosmos/cosmos-sdk/types" + + abibind "github.com/ethereum/go-ethereum/accounts/abi/bind" + gethcommon "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/common/hexutil" + gethcore "github.com/ethereum/go-ethereum/core/types" + "github.com/stretchr/testify/suite" + + "github.com/NibiruChain/nibiru/v2/eth" + "github.com/NibiruChain/nibiru/v2/x/evm" + "github.com/NibiruChain/nibiru/v2/x/evm/embeds" + "github.com/NibiruChain/nibiru/v2/x/evm/evmtest" + "github.com/NibiruChain/nibiru/v2/x/evm/precompile" +) + +type UtilsSuite struct { + suite.Suite +} + +func (s *UtilsSuite) TestAttrsToJSON() { + testCases := []struct { + name string + attrs []abci.EventAttribute + want string + }{ + { + name: "repeated key - last value wins", + attrs: []abci.EventAttribute{ + {Key: "action", Value: "first"}, + {Key: "action", Value: "second"}, + {Key: "amount", Value: "100"}, + }, + want: `{"action":"first","amount":"100"}`, + }, + { + name: "three unique attributes", + attrs: []abci.EventAttribute{ + {Key: "sender", Value: "addr1"}, + {Key: "recipient", Value: "addr2"}, + {Key: "amount", Value: "150"}, + }, + want: `{"sender":"addr1","recipient":"addr2","amount":"150"}`, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + got := string(precompile.AttrsToJSON(tc.attrs)) + s.Equal(tc.want, got) + }) + } +} + +func (s *UtilsSuite) TestEmitEventAbciEvent() { + abiEventName := precompile.EvmEventAbciEvent + abi := embeds.SmartContract_FunToken.ABI + event, some := abi.Events[abiEventName] + s.True(some, abiEventName) + eventId := event.ID + + deps := evmtest.NewTestDeps() + db := deps.NewStateDB() + + s.T().Log("Mint coins to generate ABCI events") + startIdx := len(deps.Ctx.EventManager().Events()) + dbStartIdx := len(db.Logs()) + err := deps.App.BankKeeper.MintCoins(deps.Ctx, evm.ModuleName, + sdk.NewCoins(sdk.NewInt64Coin(evm.EVMBankDenom, 420_000)), + ) + s.NoError(err) + + abciEvents := deps.Ctx.EventManager().Events()[startIdx:] + s.Lenf(abciEvents, 2, "%+s", abciEvents) + + emittingAddr := precompile.PrecompileAddr_Wasm + precompile.EmitEventAbciEvents(deps.Ctx, db, abciEvents, emittingAddr) + blockNumber := uint64(deps.Ctx.BlockHeight()) + evmAddrBech32 := eth.EthAddrToNibiruAddr(evm.EVM_MODULE_ADDRESS) + type Want struct { + EventLog gethcore.Log + } + wants := []Want{ + { + EventLog: gethcore.Log{ + Address: emittingAddr, + Topics: []gethcommon.Hash{ + eventId, + precompile.EventTopicFromString(`coin_received`), + }, + Data: []byte(fmt.Sprintf( + `{"eventType":"coin_received","receiver":"%s","amount":"420000unibi"}`, evmAddrBech32), + ), + BlockNumber: blockNumber, + Index: uint(dbStartIdx), + }, + }, + { + EventLog: gethcore.Log{ + Address: emittingAddr, + Topics: []gethcommon.Hash{ + eventId, + precompile.EventTopicFromString(`coinbase`), + }, + Data: []byte(fmt.Sprintf( + `{"eventType":"coinbase","minter":"%s","amount":"420000unibi"}`, evmAddrBech32), + ), + BlockNumber: blockNumber, + Index: uint(dbStartIdx + 1), + }, + }, + } + + s.T().Log("Define the ABI and smart contract that will unpack the event data") + + boundContract := abibind.NewBoundContract( + emittingAddr, + *abi, + // verbose but descriptive to write out the interface implementations that are unused + (abibind.ContractCaller)(nil), + (abibind.ContractTransactor)(nil), + (abibind.ContractFilterer)(nil), + ) + + debugBz, _ := json.MarshalIndent(abciEvents, "", " ") + dbLogs := db.Logs() + for idx, want := range wants { + gotEventLog := *dbLogs[dbStartIdx+idx] + + s.T().Log("Check event log fields") + // logDataHex: Geth stores the bytes as a hex string (hexutil.Bytes) + logDataHex := hexutil.Bytes(gotEventLog.Data).String() + logDataHexDecoded, err := hexutil.Decode(logDataHex) + s.NoErrorf(err, "logDataHex: %s") + s.Contains(string(logDataHexDecoded), string(want.EventLog.Data)) + { + w, g := want.EventLog.Topics, gotEventLog.Topics + s.Require().EqualValuesf(w, g, "events:\n%#s", debugBz) + } + { + w, g := want.EventLog.Address.Hex(), gotEventLog.Address.Hex() + s.Require().EqualValuesf(w, g, "events:\n%#s", debugBz) + } + { + w, g := string(want.EventLog.Data), string(gotEventLog.Data) + s.Require().Containsf(g, w, "events:\n%#s", debugBz) + } + + s.T().Log("Use geth/.../abi/bind Go bindings to test ABI event decoding") + eventMap := make(map[string]any) + err = boundContract.UnpackLogIntoMap(eventMap, abiEventName, gotEventLog) + s.Require().NoError(err) + + abciEventValUntyped, isSome := eventMap["abciEvent"] + s.Truef(isSome, "%+s", eventMap) + abciEventVal, ok := abciEventValUntyped.(string) + s.True(ok, "%+s\nttype of abciEventVal: %T", eventMap, abciEventValUntyped) + s.Equal(string(want.EventLog.Data), string(abciEventVal), "%+s", eventMap) + + _, isSome = eventMap["eventType"] + s.Truef(isSome, "%+s", eventMap) + } +} diff --git a/x/evm/precompile/wasm.go b/x/evm/precompile/wasm.go index c7095a2c6..7d1da8729 100644 --- a/x/evm/precompile/wasm.go +++ b/x/evm/precompile/wasm.go @@ -46,6 +46,8 @@ func (p precompileWasm) Run( // Gracefully handles "out of gas" defer HandleOutOfGasPanic(&err)() + abciEventsStartIdx := len(startResult.CacheCtx.EventManager().Events()) + // NOTE: The NibiruBankKeeper needs to reference the current [vm.StateDB] before // any operation that has the potential to use Bank send methods. This will // guarantee that [evmkeeper.Keeper.SetAccBalance] journal changes are @@ -72,8 +74,16 @@ func (p precompileWasm) Run( return nil, err } - // TODO: Emit EVM events + // Emit extra events for the EVM if this is a transaction // https://github.com/NibiruChain/nibiru/issues/2121 + if isMutation[PrecompileMethod(startResult.Method.Name)] { + EmitEventAbciEvents( + startResult.CacheCtx, + startResult.StateDB, + startResult.CacheCtx.EventManager().Events()[abciEventsStartIdx:], + p.Address(), + ) + } // Gas consumed by a local gas meter // The reason it's unnecessary to check for a success value is because diff --git a/x/evm/statedb/statedb.go b/x/evm/statedb/statedb.go index 4c729ef34..1306dfc7f 100644 --- a/x/evm/statedb/statedb.go +++ b/x/evm/statedb/statedb.go @@ -121,7 +121,9 @@ func (s *StateDB) GetCacheContext() *sdk.Context { return &s.cacheCtx } -// AddLog adds a log, called by evm. +// AddLog adds to the EVM's event log for the current transaction. +// [AddLog] uses the [TxConfig] to populate the tx hash, block hash, tx index, +// and event log index. func (s *StateDB) AddLog(log *gethcore.Log) { s.Journal.append(addLogChange{}) @@ -132,7 +134,7 @@ func (s *StateDB) AddLog(log *gethcore.Log) { s.logs = append(s.logs, log) } -// Logs returns the logs of current transaction. +// Logs returns the event logs of current transaction. func (s *StateDB) Logs() []*gethcore.Log { return s.logs }