-
Notifications
You must be signed in to change notification settings - Fork 193
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(evm): additional tests and refactors (#2176)
* chore: cleanup funtoken test * Update funtoken_test.go * refactor: update wasm tests * Update export.go * Update debug.go * fix: TestJournalReversion * test(evm): add dirty state attack tests * Update wasm_test.go * test: add TestWasmPrecompileDirtyStateAttack4 * Update wasm_test.go * Update CHANGELOG.md * test(evm): add wasm precompile staking test * fix: total supply calc in tests * test(evm): remove dirty state attacks 1-3 due to being duplicates * refactor: variable names
- Loading branch information
Showing
24 changed files
with
693 additions
and
332 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
x/evm/embeds/artifacts/contracts/TestDirtyStateAttack4.sol/TestDirtyStateAttack4.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
{ | ||
"_format": "hh-sol-artifact-1", | ||
"contractName": "TestDirtyStateAttack4", | ||
"sourceName": "contracts/TestDirtyStateAttack4.sol", | ||
"abi": [ | ||
{ | ||
"inputs": [], | ||
"stateMutability": "payable", | ||
"type": "constructor" | ||
}, | ||
{ | ||
"inputs": [ | ||
{ | ||
"internalType": "string", | ||
"name": "wasmAddr", | ||
"type": "string" | ||
}, | ||
{ | ||
"internalType": "bytes", | ||
"name": "msgArgs", | ||
"type": "bytes" | ||
} | ||
], | ||
"name": "attack", | ||
"outputs": [], | ||
"stateMutability": "nonpayable", | ||
"type": "function" | ||
}, | ||
{ | ||
"inputs": [], | ||
"name": "getCounter", | ||
"outputs": [ | ||
{ | ||
"internalType": "uint256", | ||
"name": "", | ||
"type": "uint256" | ||
} | ||
], | ||
"stateMutability": "view", | ||
"type": "function" | ||
} | ||
], | ||
"bytecode": "0x60806040526000805561084a806100176000396000f3fe608060405234801561001057600080fd5b50600436106100365760003560e01c806333c889971461003b5780638ada066e14610057575b600080fd5b610055600480360381019061005091906102d6565b610075565b005b61005f6101e4565b60405161006c9190610370565b60405180910390f35b600080815480929190610087906103ba565b91905055506000600167ffffffffffffffff8111156100a9576100a8610402565b5b6040519080825280602002602001820160405280156100e257816020015b6100cf6101ed565b8152602001906001900390816100c75790505b50905060405180604001604052806040518060400160405280600581526020017f756e6962690000000000000000000000000000000000000000000000000000008152508152602001620f42408152508160008151811061014657610145610431565b5b602002602001018190525061080273ffffffffffffffffffffffffffffffffffffffff166361ffaee486868686866040518663ffffffff1660e01b8152600401610194959493929190610689565b6000604051808303816000875af11580156101b3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101dc91906107cb565b505050505050565b60008054905090565b604051806040016040528060608152602001600081525090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126102405761023f61021b565b5b8235905067ffffffffffffffff81111561025d5761025c610220565b5b60208301915083600182028301111561027957610278610225565b5b9250929050565b60008083601f8401126102965761029561021b565b5b8235905067ffffffffffffffff8111156102b3576102b2610220565b5b6020830191508360018202830111156102cf576102ce610225565b5b9250929050565b600080600080604085870312156102f0576102ef610211565b5b600085013567ffffffffffffffff81111561030e5761030d610216565b5b61031a8782880161022a565b9450945050602085013567ffffffffffffffff81111561033d5761033c610216565b5b61034987828801610280565b925092505092959194509250565b6000819050919050565b61036a81610357565b82525050565b60006020820190506103856000830184610361565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103c582610357565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103f7576103f661038b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061049d8385610460565b93506104aa838584610471565b6104b383610480565b840190509392505050565b600082825260208201905092915050565b60006104db83856104be565b93506104e8838584610471565b6104f183610480565b840190509392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610562578082015181840152602081019050610547565b60008484015250505050565b600061057982610528565b6105838185610533565b9350610593818560208601610544565b61059c81610480565b840191505092915050565b6105b081610357565b82525050565b600060408301600083015184820360008601526105d3828261056e565b91505060208301516105e860208601826105a7565b508091505092915050565b60006105ff83836105b6565b905092915050565b6000602082019050919050565b600061061f826104fc565b6106298185610507565b93508360208202850161063b85610518565b8060005b85811015610677578484038952815161065885826105f3565b945061066383610607565b925060208a0199505060018101905061063f565b50829750879550505050505092915050565b600060608201905081810360008301526106a4818789610491565b905081810360208301526106b98185876104cf565b905081810360408301526106cd8184610614565b90509695505050505050565b600080fd5b6106e782610480565b810181811067ffffffffffffffff8211171561070657610705610402565b5b80604052505050565b6000610719610207565b905061072582826106de565b919050565b600067ffffffffffffffff82111561074557610744610402565b5b61074e82610480565b9050602081019050919050565b600061076e6107698461072a565b61070f565b90508281526020810184848401111561078a576107896106d9565b5b610795848285610544565b509392505050565b600082601f8301126107b2576107b161021b565b5b81516107c284826020860161075b565b91505092915050565b6000602082840312156107e1576107e0610211565b5b600082015167ffffffffffffffff8111156107ff576107fe610216565b5b61080b8482850161079d565b9150509291505056fea26469706673582212208caac82ecde5bb31fb5b34bd6b569b73277f17eb9b132d65942a718f83178c9c64736f6c63430008180033", | ||
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100365760003560e01c806333c889971461003b5780638ada066e14610057575b600080fd5b610055600480360381019061005091906102d6565b610075565b005b61005f6101e4565b60405161006c9190610370565b60405180910390f35b600080815480929190610087906103ba565b91905055506000600167ffffffffffffffff8111156100a9576100a8610402565b5b6040519080825280602002602001820160405280156100e257816020015b6100cf6101ed565b8152602001906001900390816100c75790505b50905060405180604001604052806040518060400160405280600581526020017f756e6962690000000000000000000000000000000000000000000000000000008152508152602001620f42408152508160008151811061014657610145610431565b5b602002602001018190525061080273ffffffffffffffffffffffffffffffffffffffff166361ffaee486868686866040518663ffffffff1660e01b8152600401610194959493929190610689565b6000604051808303816000875af11580156101b3573d6000803e3d6000fd5b505050506040513d6000823e3d601f19601f820116820180604052508101906101dc91906107cb565b505050505050565b60008054905090565b604051806040016040528060608152602001600081525090565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f8401126102405761023f61021b565b5b8235905067ffffffffffffffff81111561025d5761025c610220565b5b60208301915083600182028301111561027957610278610225565b5b9250929050565b60008083601f8401126102965761029561021b565b5b8235905067ffffffffffffffff8111156102b3576102b2610220565b5b6020830191508360018202830111156102cf576102ce610225565b5b9250929050565b600080600080604085870312156102f0576102ef610211565b5b600085013567ffffffffffffffff81111561030e5761030d610216565b5b61031a8782880161022a565b9450945050602085013567ffffffffffffffff81111561033d5761033c610216565b5b61034987828801610280565b925092505092959194509250565b6000819050919050565b61036a81610357565b82525050565b60006020820190506103856000830184610361565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006103c582610357565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036103f7576103f661038b565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600082825260208201905092915050565b82818337600083830152505050565b6000601f19601f8301169050919050565b600061049d8385610460565b93506104aa838584610471565b6104b383610480565b840190509392505050565b600082825260208201905092915050565b60006104db83856104be565b93506104e8838584610471565b6104f183610480565b840190509392505050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610562578082015181840152602081019050610547565b60008484015250505050565b600061057982610528565b6105838185610533565b9350610593818560208601610544565b61059c81610480565b840191505092915050565b6105b081610357565b82525050565b600060408301600083015184820360008601526105d3828261056e565b91505060208301516105e860208601826105a7565b508091505092915050565b60006105ff83836105b6565b905092915050565b6000602082019050919050565b600061061f826104fc565b6106298185610507565b93508360208202850161063b85610518565b8060005b85811015610677578484038952815161065885826105f3565b945061066383610607565b925060208a0199505060018101905061063f565b50829750879550505050505092915050565b600060608201905081810360008301526106a4818789610491565b905081810360208301526106b98185876104cf565b905081810360408301526106cd8184610614565b90509695505050505050565b600080fd5b6106e782610480565b810181811067ffffffffffffffff8211171561070657610705610402565b5b80604052505050565b6000610719610207565b905061072582826106de565b919050565b600067ffffffffffffffff82111561074557610744610402565b5b61074e82610480565b9050602081019050919050565b600061076e6107698461072a565b61070f565b90508281526020810184848401111561078a576107896106d9565b5b610795848285610544565b509392505050565b600082601f8301126107b2576107b161021b565b5b81516107c284826020860161075b565b91505092915050565b6000602082840312156107e1576107e0610211565b5b600082015167ffffffffffffffff8111156107ff576107fe610216565b5b61080b8482850161079d565b9150509291505056fea26469706673582212208caac82ecde5bb31fb5b34bd6b569b73277f17eb9b132d65942a718f83178c9c64736f6c63430008180033", | ||
"linkReferences": {}, | ||
"deployedLinkReferences": {} | ||
} |
Oops, something went wrong.