Skip to content

Commit

Permalink
Add built artifacts for Ethereum contracts to simplify testing
Browse files Browse the repository at this point in the history
  • Loading branch information
ilblackdragon committed Sep 7, 2020
1 parent b8a1b3e commit cc4ec1f
Show file tree
Hide file tree
Showing 13 changed files with 422 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ docker-build
/keystore/
/chain/client/tmp_bench
testdir/
runtime/near-evm-runner/tests/build

# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Expand Down
8 changes: 8 additions & 0 deletions runtime/near-evm-runner/tests/build/ConstructorRevert.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"inputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "constructor"
}
]
1 change: 1 addition & 0 deletions runtime/near-evm-runner/tests/build/ConstructorRevert.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6080604052348015600f57600080fd5b5060056004146086576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260188152602001807f4572726f72204465706c6f79696e6720436f6e7472616374000000000000000081525060200191505060405180910390fd5b603e8060936000396000f3fe6080604052600080fdfea265627a7a723158203667e47f55606e5f72d16e0d9a81ed4435273fcfa1ee79bf9545dc524d930d2f64736f6c63430005100032
59 changes: 59 additions & 0 deletions runtime/near-evm-runner/tests/build/Create2Factory.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
[
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"constant": false,
"inputs": [
{
"internalType": "bytes32",
"name": "_salt",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "_contractBytecode",
"type": "bytes"
}
],
"name": "deploy",
"outputs": [
{
"internalType": "address payable",
"name": "addr",
"type": "address"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "bytes32",
"name": "_salt",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "_contractBytecode",
"type": "bytes"
}
],
"name": "testDoubleDeploy",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
}
]
1 change: 1 addition & 0 deletions runtime/near-evm-runner/tests/build/Create2Factory.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b50610758806100206000396000f3fe6080604052600436106100295760003560e01c80639f45e8151461002b578063cdcb760a14610108575b005b6100ee6004803603604081101561004157600080fd5b81019080803590602001909291908035906020019064010000000081111561006857600080fd5b82018360208201111561007a57600080fd5b8035906020019184600183028401116401000000008311171561009c57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050919291929050505061021a565b604051808215151515815260200191505060405180910390f35b34801561011457600080fd5b506101d86004803603604081101561012b57600080fd5b81019080803590602001909291908035906020019064010000000081111561015257600080fd5b82018360208201111561016457600080fd5b8035906020019184600183028401116401000000008311171561018657600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505091929192905050506106c7565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b60008061022784846106c7565b905060008190508073ffffffffffffffffffffffffffffffffffffffff1663eef4c90f60056040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b15801561028257600080fd5b505af1158015610296573d6000803e3d6000fd5b5050505060058173ffffffffffffffffffffffffffffffffffffffff16636e4d2a346040518163ffffffff1660e01b815260040160206040518083038186803b1580156102e257600080fd5b505afa1580156102f6573d6000803e3d6000fd5b505050506040513d602081101561030c57600080fd5b810190808051906020019092919050505014610390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601a8152602001807f7072652d6465737472756374696f6e2077726f6e672075696e7400000000000081525060200191505060405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663d37c6c9e6040518163ffffffff1660e01b8152600401600060405180830381600087803b1580156103d857600080fd5b505af11580156103ec573d6000803e3d6000fd5b5050505060606103fb826106db565b90506000815114610474576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601c8152602001807f706f73742d6465737472756374696f6e20636f6465206c656e6774680000000081525060200191505060405180910390fd5b61047e86866106c7565b5060008273ffffffffffffffffffffffffffffffffffffffff16636e4d2a346040518163ffffffff1660e01b815260040160206040518083038186803b1580156104c757600080fd5b505afa1580156104db573d6000803e3d6000fd5b505050506040513d60208110156104f157600080fd5b810190808051906020019092919050505014610575576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040180806020018281038252601b8152602001807f706f73742d6465737472756374696f6e2077726f6e672075696e74000000000081525060200191505060405180910390fd5b8173ffffffffffffffffffffffffffffffffffffffff1663eef4c90f60036040518263ffffffff1660e01b815260040180828152602001915050600060405180830381600087803b1580156105c957600080fd5b505af11580156105dd573d6000803e3d6000fd5b5050505060038273ffffffffffffffffffffffffffffffffffffffff16636e4d2a346040518163ffffffff1660e01b815260040160206040518083038186803b15801561062957600080fd5b505afa15801561063d573d6000803e3d6000fd5b505050506040513d602081101561065357600080fd5b8101908080519060200190929190505050146106ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004018080602001828103825260228152602001806107026022913960400191505060405180910390fd5b6001935050505092915050565b6000828251602084016000f5905092915050565b60606040519050813b8082526020820181600082863c818352818101604052505091905056fe706f73742d6465737472756374696f6e2073746f7265642077726f6e672075696e74a265627a7a7231582057b6addf30c31c49aa94429f78664940ffa8f1922153be7c94c853fa4932031c64736f6c63430005100032
70 changes: 70 additions & 0 deletions runtime/near-evm-runner/tests/build/SelfDestruct.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
[
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"constant": true,
"inputs": [],
"name": "storedAddress",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "storedUint",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "storeAddress",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "_number",
"type": "uint256"
}
],
"name": "storeUint",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "destruction",
"outputs": [],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
}
]
1 change: 1 addition & 0 deletions runtime/near-evm-runner/tests/build/SelfDestruct.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
608060405234801561001057600080fd5b506101fc806100206000396000f3fe60806040526004361061004a5760003560e01c80636e4d2a341461004c5780638f63640e14610077578063d37c6c9e146100ce578063eef4c90f146100e5578063f2c4da9314610120575b005b34801561005857600080fd5b50610061610137565b6040518082815260200191505060405180910390f35b34801561008357600080fd5b5061008c61013d565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b3480156100da57600080fd5b506100e3610162565b005b3480156100f157600080fd5b5061011e6004803603602081101561010857600080fd5b810190808035906020019092919050505061017b565b005b34801561012c57600080fd5b50610135610185565b005b60015481565b6000809054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b3373ffffffffffffffffffffffffffffffffffffffff16ff5b8060018190555050565b336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555056fea265627a7a7231582049134aca36ca008aa7d94838f31a297f561997c03ec02dedcb7b63aa26289cd664736f6c63430005100032
188 changes: 188 additions & 0 deletions runtime/near-evm-runner/tests/build/SolTests.abi
Original file line number Diff line number Diff line change
@@ -0,0 +1,188 @@
[
{
"inputs": [],
"payable": true,
"stateMutability": "payable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": true,
"internalType": "address",
"name": "_contract",
"type": "address"
},
{
"indexed": false,
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "DeployEvent",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "_number",
"type": "uint256"
}
],
"name": "SomeEvent",
"type": "event"
},
{
"payable": true,
"stateMutability": "payable",
"type": "fallback"
},
{
"constant": true,
"inputs": [],
"name": "balance",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "view",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "address",
"name": "_recipient",
"type": "address"
},
{
"internalType": "uint256",
"name": "_amount",
"type": "uint256"
}
],
"name": "transferTo",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "_aNumber",
"type": "uint256"
}
],
"name": "deployNewGuy",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "_aNumber",
"type": "uint256"
}
],
"name": "payNewGuy",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [],
"name": "returnSomeFunds",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
},
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"payable": true,
"stateMutability": "payable",
"type": "function"
},
{
"constant": false,
"inputs": [
{
"internalType": "uint256",
"name": "_aNumber",
"type": "uint256"
}
],
"name": "emitIt",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"payable": false,
"stateMutability": "nonpayable",
"type": "function"
},
{
"constant": true,
"inputs": [],
"name": "precompileTest",
"outputs": [],
"payable": false,
"stateMutability": "pure",
"type": "function"
}
]
1 change: 1 addition & 0 deletions runtime/near-evm-runner/tests/build/SolTests.bin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6080604052610751806100136000396000f3fe6080604052600436106100705760003560e01c8063299fb0431161004e578063299fb043146101af5780632ccb1b30146101c65780639d9f9a6e14610235578063b69ef8a81461028657610070565b80630a84cba514610072578063111e0b12146100e757806314d54f541461015c575b005b61009e6004803603602081101561008857600080fd5b81019080803590602001909291905050506102b1565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b610113600480360360208110156100fd57600080fd5b8101908080359060200190929190505050610390565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561016857600080fd5b506101956004803603602081101561017f57600080fd5b81019080803590602001909291905050506103dc565b604051808215151515815260200191505060405180910390f35b3480156101bb57600080fd5b506101c461041e565b005b3480156101d257600080fd5b5061021f600480360360408110156101e957600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610420565b6040518082815260200191505060405180910390f35b61023d610479565b604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390f35b34801561029257600080fd5b5061029b6104da565b6040518082815260200191505060405180910390f35b6000806000836040516102c3906104e2565b80828152602001915050604051809103906000f0801580156102e9573d6000803e3d6000fd5b5090508073ffffffffffffffffffffffffffffffffffffffff166108fc349081150290604051600060405180830381858888f19350505050158015610332573d6000803e3d6000fd5b508073ffffffffffffffffffffffffffffffffffffffff167fa53ffc4fb91f5ca8287e168fc73db3b0b384a6ca275650f885a1740ef7a0bc1c346040518082815260200191505060405180910390a280348191509250925050915091565b600080600034846040516103a3906104e2565b808281526020019150506040518091039082f0801580156103c8573d6000803e3d6000fd5b509050905080348191509250925050915091565b60007f379340f64b65a8890c7ea4f6d86d2359beaf41080f36a7ea64b78a2c06eee3f0826040518082815260200191505060405180910390a160019050919050565b565b60008273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f19350505050158015610468573d6000803e3d6000fd5b506104716104da565b905092915050565b6000803373ffffffffffffffffffffffffffffffffffffffff166108fc600234816104a057fe5b049081150290604051600060405180830381858888f193505050501580156104cc573d6000803e3d6000fd5b503334819150915091509091565b600047905090565b61022d806104f08339019056fe6080604052600660005560405161022d38038061022d8339818101604052602081101561002b57600080fd5b810190808051906020019092919050505080600081905550506101da806100536000396000f3fe60806040526004361061003f5760003560e01c80632ccb1b301461004157806339c117a4146100b0578063b69ef8a8146100df578063e6a899b61461010a575b005b34801561004d57600080fd5b5061009a6004803603604081101561006457600080fd5b81019080803573ffffffffffffffffffffffffffffffffffffffff16906020019092919080359060200190929190505050610135565b6040518082815260200191505060405180910390f35b3480156100bc57600080fd5b506100c561018e565b604051808215151515815260200191505060405180910390f35b3480156100eb57600080fd5b506100f4610197565b6040518082815260200191505060405180910390f35b34801561011657600080fd5b5061011f61019f565b6040518082815260200191505060405180910390f35b60008273ffffffffffffffffffffffffffffffffffffffff166108fc839081150290604051600060405180830381858888f1935050505015801561017d573d6000803e3d6000fd5b50610186610197565b905092915050565b60006001905090565b600047905090565b6000548156fea265627a7a72315820ea83af7ddb8234e4b841b684510c134b4b7a908fa8f04ffa0bc7a26e95ccc98064736f6c63430005100032a265627a7a72315820380ec69db676ca33c704f78f87c7eb2076dbf6b096c675fae266364c1b0587cc64736f6c63430005100032
Loading

0 comments on commit cc4ec1f

Please sign in to comment.