Skip to content

Commit

Permalink
Add all required erc20 mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
0xNeshi committed Sep 24, 2024
1 parent 23ca2af commit 53ab7f0
Show file tree
Hide file tree
Showing 5 changed files with 127 additions and 2 deletions.
4 changes: 2 additions & 2 deletions examples/safe-erc20/tests/mock/erc20.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ use e2e::Wallet;
sol! {
#[allow(missing_docs)]
// Built with Remix IDE; solc v0.8.21+commit.d9974bed
#[sol(rpc, bytecode="608060405234801562000010575f80fd5b506040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525081600390816200008e91906200030d565b508060049081620000a091906200030d565b505050620003f1565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806200012557607f821691505b6020821081036200013b576200013a620000e0565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026200019f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000162565b620001ab868362000162565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f620001f5620001ef620001e984620001c3565b620001cc565b620001c3565b9050919050565b5f819050919050565b6200021083620001d5565b620002286200021f82620001fc565b8484546200016e565b825550505050565b5f90565b6200023e62000230565b6200024b81848462000205565b505050565b5b818110156200027257620002665f8262000234565b60018101905062000251565b5050565b601f821115620002c1576200028b8162000141565b620002968462000153565b81016020851015620002a6578190505b620002be620002b58562000153565b83018262000250565b50505b505050565b5f82821c905092915050565b5f620002e35f1984600802620002c6565b1980831691505092915050565b5f620002fd8383620002d2565b9150826002028217905092915050565b6200031882620000a9565b67ffffffffffffffff811115620003345762000333620000b3565b5b6200034082546200010d565b6200034d82828562000276565b5f60209050601f83116001811462000383575f84156200036e578287015190505b6200037a8582620002f0565b865550620003e9565b601f198416620003938662000141565b5f5b82811015620003bc5784890151825560018201915060208501945060208101905062000395565b86831015620003dc5784890151620003d8601f891682620002d2565b8355505b6001600288020188555050505b505050505050565b610efb80620003ff5f395ff3fe608060405234801561000f575f80fd5b506004361061009c575f3560e01c806340c10f191161006457806340c10f191461015a57806370a082311461017657806395d89b41146101a6578063a9059cbb146101c4578063dd62ed3e146101f45761009c565b806306fdde03146100a0578063095ea7b3146100be57806318160ddd146100ee57806323b872dd1461010c578063313ce5671461013c575b5f80fd5b6100a8610224565b6040516100b59190610b74565b60405180910390f35b6100d860048036038101906100d39190610c25565b6102b4565b6040516100e59190610c7d565b60405180910390f35b6100f66102c7565b6040516101039190610ca5565b60405180910390f35b61012660048036038101906101219190610cbe565b6102d0565b6040516101339190610c7d565b60405180910390f35b6101446102e5565b6040516101519190610d29565b60405180910390f35b610174600480360381019061016f9190610c25565b6102ed565b005b610190600480360381019061018b9190610d42565b6102fb565b60405161019d9190610ca5565b60405180910390f35b6101ae61030c565b6040516101bb9190610b74565b60405180910390f35b6101de60048036038101906101d99190610c25565b61039c565b6040516101eb9190610c7d565b60405180910390f35b61020e60048036038101906102099190610d6d565b6103af565b60405161021b9190610ca5565b60405180910390f35b60606003805461023390610dd8565b80601f016020809104026020016040519081016040528092919081815260200182805461025f90610dd8565b80156102aa5780601f10610281576101008083540402835291602001916102aa565b820191905f5260205f20905b81548152906001019060200180831161028d57829003601f168201915b5050505050905090565b5f6102bf8383610431565b905092915050565b5f600254905090565b5f6102dc848484610453565b90509392505050565b5f6012905090565b6102f78282610481565b5050565b5f61030582610500565b9050919050565b60606004805461031b90610dd8565b80601f016020809104026020016040519081016040528092919081815260200182805461034790610dd8565b80156103925780601f1061036957610100808354040283529160200191610392565b820191905f5260205f20905b81548152906001019060200180831161037557829003601f168201915b5050505050905090565b5f6103a78383610545565b905092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f8061043b610567565b905061044881858561056e565b600191505092915050565b5f8061045d610567565b905061046a858285610580565b610475858585610612565b60019150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104f1575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016104e89190610e17565b60405180910390fd5b6104fc5f8383610702565b5050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f8061054f610567565b905061055c818585610612565b600191505092915050565b5f33905090565b61057b838383600161091b565b505050565b5f61058b84846103af565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461060c57818110156105fd578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016105f493929190610e30565b60405180910390fd5b61060b84848484035f61091b565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610682575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016106799190610e17565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036106f2575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106e99190610e17565b60405180910390fd5b6106fd838383610702565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610752578060025f8282546107469190610e92565b92505081905550610820565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156107db578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016107d293929190610e30565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610867578060025f82825403925050819055506108b1565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161090e9190610ca5565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361098b575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016109829190610e17565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036109fb575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016109f29190610e17565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508015610ae4578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610adb9190610ca5565b60405180910390a35b50505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610b21578082015181840152602081019050610b06565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610b4682610aea565b610b508185610af4565b9350610b60818560208601610b04565b610b6981610b2c565b840191505092915050565b5f6020820190508181035f830152610b8c8184610b3c565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610bc182610b98565b9050919050565b610bd181610bb7565b8114610bdb575f80fd5b50565b5f81359050610bec81610bc8565b92915050565b5f819050919050565b610c0481610bf2565b8114610c0e575f80fd5b50565b5f81359050610c1f81610bfb565b92915050565b5f8060408385031215610c3b57610c3a610b94565b5b5f610c4885828601610bde565b9250506020610c5985828601610c11565b9150509250929050565b5f8115159050919050565b610c7781610c63565b82525050565b5f602082019050610c905f830184610c6e565b92915050565b610c9f81610bf2565b82525050565b5f602082019050610cb85f830184610c96565b92915050565b5f805f60608486031215610cd557610cd4610b94565b5b5f610ce286828701610bde565b9350506020610cf386828701610bde565b9250506040610d0486828701610c11565b9150509250925092565b5f60ff82169050919050565b610d2381610d0e565b82525050565b5f602082019050610d3c5f830184610d1a565b92915050565b5f60208284031215610d5757610d56610b94565b5b5f610d6484828501610bde565b91505092915050565b5f8060408385031215610d8357610d82610b94565b5b5f610d9085828601610bde565b9250506020610da185828601610bde565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610def57607f821691505b602082108103610e0257610e01610dab565b5b50919050565b610e1181610bb7565b82525050565b5f602082019050610e2a5f830184610e08565b92915050565b5f606082019050610e435f830186610e08565b610e506020830185610c96565b610e5d6040830184610c96565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610e9c82610bf2565b9150610ea783610bf2565b9250828201905080821115610ebf57610ebe610e65565b5b9291505056fea26469706673582212204b0d5b8c644aa4b312a9bee1615964e800240731dcc271c19c1615f2940a1ed564736f6c63430008150033")]
#[sol(rpc, bytecode="608060405234801562000010575f80fd5b506040518060400160405280600981526020017f45524332304d6f636b00000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b000000000000000000000000000000000000000000000000000000000081525081600390816200008e91906200030d565b508060049081620000a091906200030d565b505050620003f1565b5f81519050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806200012557607f821691505b6020821081036200013b576200013a620000e0565b5b50919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026200019f7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000162565b620001ab868362000162565b95508019841693508086168417925050509392505050565b5f819050919050565b5f819050919050565b5f620001f5620001ef620001e984620001c3565b620001cc565b620001c3565b9050919050565b5f819050919050565b6200021083620001d5565b620002286200021f82620001fc565b8484546200016e565b825550505050565b5f90565b6200023e62000230565b6200024b81848462000205565b505050565b5b818110156200027257620002665f8262000234565b60018101905062000251565b5050565b601f821115620002c1576200028b8162000141565b620002968462000153565b81016020851015620002a6578190505b620002be620002b58562000153565b83018262000250565b50505b505050565b5f82821c905092915050565b5f620002e35f1984600802620002c6565b1980831691505092915050565b5f620002fd8383620002d2565b9150826002028217905092915050565b6200031882620000a9565b67ffffffffffffffff811115620003345762000333620000b3565b5b6200034082546200010d565b6200034d82828562000276565b5f60209050601f83116001811462000383575f84156200036e578287015190505b6200037a8582620002f0565b865550620003e9565b601f198416620003938662000141565b5f5b82811015620003bc5784890151825560018201915060208501945060208101905062000395565b86831015620003dc5784890151620003d8601f891682620002d2565b8355505b6001600288020188555050505b505050505050565b610efb80620003ff5f395ff3fe608060405234801561000f575f80fd5b506004361061009c575f3560e01c806340c10f191161006457806340c10f191461015a57806370a082311461017657806395d89b41146101a6578063a9059cbb146101c4578063dd62ed3e146101f45761009c565b806306fdde03146100a0578063095ea7b3146100be57806318160ddd146100ee57806323b872dd1461010c578063313ce5671461013c575b5f80fd5b6100a8610224565b6040516100b59190610b74565b60405180910390f35b6100d860048036038101906100d39190610c25565b6102b4565b6040516100e59190610c7d565b60405180910390f35b6100f66102c7565b6040516101039190610ca5565b60405180910390f35b61012660048036038101906101219190610cbe565b6102d0565b6040516101339190610c7d565b60405180910390f35b6101446102e5565b6040516101519190610d29565b60405180910390f35b610174600480360381019061016f9190610c25565b6102ed565b005b610190600480360381019061018b9190610d42565b6102fb565b60405161019d9190610ca5565b60405180910390f35b6101ae61030c565b6040516101bb9190610b74565b60405180910390f35b6101de60048036038101906101d99190610c25565b61039c565b6040516101eb9190610c7d565b60405180910390f35b61020e60048036038101906102099190610d6d565b6103af565b60405161021b9190610ca5565b60405180910390f35b60606003805461023390610dd8565b80601f016020809104026020016040519081016040528092919081815260200182805461025f90610dd8565b80156102aa5780601f10610281576101008083540402835291602001916102aa565b820191905f5260205f20905b81548152906001019060200180831161028d57829003601f168201915b5050505050905090565b5f6102bf8383610431565b905092915050565b5f600254905090565b5f6102dc848484610453565b90509392505050565b5f6012905090565b6102f78282610481565b5050565b5f61030582610500565b9050919050565b60606004805461031b90610dd8565b80601f016020809104026020016040519081016040528092919081815260200182805461034790610dd8565b80156103925780601f1061036957610100808354040283529160200191610392565b820191905f5260205f20905b81548152906001019060200180831161037557829003601f168201915b5050505050905090565b5f6103a78383610545565b905092915050565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f8061043b610567565b905061044881858561056e565b600191505092915050565b5f8061045d610567565b905061046a858285610580565b610475858585610612565b60019150509392505050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036104f1575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016104e89190610e17565b60405180910390fd5b6104fc5f8383610702565b5050565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b5f8061054f610567565b905061055c818585610612565b600191505092915050565b5f33905090565b61057b838383600161091b565b505050565b5f61058b84846103af565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461060c57818110156105fd578281836040517ffb8f41b20000000000000000000000000000000000000000000000000000000081526004016105f493929190610e30565b60405180910390fd5b61060b84848484035f61091b565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610682575f6040517f96c6fd1e0000000000000000000000000000000000000000000000000000000081526004016106799190610e17565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036106f2575f6040517fec442f050000000000000000000000000000000000000000000000000000000081526004016106e99190610e17565b60405180910390fd5b6106fd838383610702565b505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610752578060025f8282546107469190610e92565b92505081905550610820565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156107db578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016107d293929190610e30565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610867578060025f82825403925050819055506108b1565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161090e9190610ca5565b60405180910390a3505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff160361098b575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016109829190610e17565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036109fb575f6040517f94280d620000000000000000000000000000000000000000000000000000000081526004016109f29190610e17565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20819055508015610ae4578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051610adb9190610ca5565b60405180910390a35b50505050565b5f81519050919050565b5f82825260208201905092915050565b5f5b83811015610b21578082015181840152602081019050610b06565b5f8484015250505050565b5f601f19601f8301169050919050565b5f610b4682610aea565b610b508185610af4565b9350610b60818560208601610b04565b610b6981610b2c565b840191505092915050565b5f6020820190508181035f830152610b8c8184610b3c565b905092915050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f610bc182610b98565b9050919050565b610bd181610bb7565b8114610bdb575f80fd5b50565b5f81359050610bec81610bc8565b92915050565b5f819050919050565b610c0481610bf2565b8114610c0e575f80fd5b50565b5f81359050610c1f81610bfb565b92915050565b5f8060408385031215610c3b57610c3a610b94565b5b5f610c4885828601610bde565b9250506020610c5985828601610c11565b9150509250929050565b5f8115159050919050565b610c7781610c63565b82525050565b5f602082019050610c905f830184610c6e565b92915050565b610c9f81610bf2565b82525050565b5f602082019050610cb85f830184610c96565b92915050565b5f805f60608486031215610cd557610cd4610b94565b5b5f610ce286828701610bde565b9350506020610cf386828701610bde565b9250506040610d0486828701610c11565b9150509250925092565b5f60ff82169050919050565b610d2381610d0e565b82525050565b5f602082019050610d3c5f830184610d1a565b92915050565b5f60208284031215610d5757610d56610b94565b5b5f610d6484828501610bde565b91505092915050565b5f8060408385031215610d8357610d82610b94565b5b5f610d9085828601610bde565b9250506020610da185828601610bde565b9150509250929050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680610def57607f821691505b602082108103610e0257610e01610dab565b5b50919050565b610e1181610bb7565b82525050565b5f602082019050610e2a5f830184610e08565b92915050565b5f606082019050610e435f830186610e08565b610e506020830185610c96565b610e5d6040830184610c96565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f610e9c82610bf2565b9150610ea783610bf2565b9250828201905080821115610ebf57610ebe610e65565b5b9291505056fea264697066735822122098e48e82a2d2ff17cb731942aac20d7002c5b8470944afacca92dce20fd8178a64736f6c63430008150033")]
// SPDX-License-Identifier: MIT
contract ERC20Mock is ERC20 {
constructor() ERC20("MyToken", "MTK") {}
constructor() ERC20("ERC20Mock", "MTK") {}

function approve(address spender, uint256 value) public override returns (bool) {
return super.approve(spender, value);
Expand Down
Loading

0 comments on commit 53ab7f0

Please sign in to comment.