This repository has been archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #57 from TheWaWaR/fix-call-non-exists-contract
fix: allow call non-exists account address
- Loading branch information
Showing
6 changed files
with
202 additions
and
56 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
1 change: 1 addition & 0 deletions
1
polyjuice-tests/src/test_cases/evm-contracts/CallNonExistsContract.abi
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 @@ | ||
[{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"rawCall","outputs":[{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"}] |
1 change: 1 addition & 0 deletions
1
polyjuice-tests/src/test_cases/evm-contracts/CallNonExistsContract.bin
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 @@ | ||
60806040523480156100115760006000fd5b50610017565b610413806100266000396000f3fe60806040523480156100115760006000fd5b50600436106100305760003560e01c806356c94e701461003657610030565b60006000fd5b610050600480360381019061004b919061020c565b610066565b60405161005d91906102f5565b60405180910390f35b606060008273ffffffffffffffffffffffffffffffffffffffff1660405161008d906102df565b6000604051808303816000865af19150503d80600081146100ca576040519150601f19603f3d011682016040523d82523d6000602084013e6100cf565b606091505b505090508015156100e05760006000fd5b600060008473ffffffffffffffffffffffffffffffffffffffff166040516024016040516020818303038152906040527ff85396d7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff838183161783525050505060405161018b91906102c7565b6000604051808303816000865af19150503d80600081146101c8576040519150601f19603f3d011682016040523d82523d6000602084013e6101cd565b606091505b50915091508115156101df5760006000fd5b8093505050506101ed565050505b919050566103dc565b600081359050610205816103c1565b5b92915050565b60006020828403121561021f5760006000fd5b600061022d848285016101f6565b9150505b92915050565b600061024282610318565b61024c8185610324565b935061025c818560208601610376565b610265816103ab565b84019150505b92915050565b600061027c82610318565b6102868185610336565b9350610296818560208601610376565b8084019150505b92915050565b60006102b0600083610336565b91506102bb826103bd565b6000820190505b919050565b60006102d38284610271565b91508190505b92915050565b60006102ea826102a3565b91508190505b919050565b6000602082019050818103600083015261030f8184610237565b90505b92915050565b6000815190505b919050565b60008282526020820190505b92915050565b60008190505b92915050565b600061034d82610355565b90505b919050565b600073ffffffffffffffffffffffffffffffffffffffff821690505b919050565b60005b838110156103955780820151818401525b602081019050610379565b838111156103a4576000848401525b505b505050565b6000601f19601f83011690505b919050565b5b50565b6103ca81610342565b811415156103d85760006000fd5b5b50565bfea26469706673582212206065ddbf3ca5e52cdc9bbb8326320af0512411ef223c0f55947c75948c423fe864736f6c63430008020033 |
11 changes: 11 additions & 0 deletions
11
polyjuice-tests/src/test_cases/evm-contracts/CallNonExistsContract.sol
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,11 @@ | ||
pragma solidity >=0.6.0 <0.9.0; | ||
|
||
contract CallNonExistsContract { | ||
function rawCall(address addr) public returns (bytes memory) { | ||
(bool success0, ) = addr.call(""); | ||
require(success0); | ||
(bool success1, bytes memory data1) = addr.call(abi.encodeWithSignature("nonExistingFunction()")); | ||
require(success1); | ||
return data1; | ||
} | ||
} |
Oops, something went wrong.