From a5b15650425544ccf2ed8915a9ecefba7f473b05 Mon Sep 17 00:00:00 2001 From: "Simon.Z" Date: Fri, 26 Jan 2024 14:39:46 -0800 Subject: [PATCH] finalize on TokenPermit replacement bytecode; auto call `initialize()` after bytecode-replaced --- builtin/fork11_upgrades.go | 11 ++++++++--- meter/params.go | 19 +++++++++++++++++++ runtime/runtime.go | 39 ++++++++++++++++++++++++++++++-------- tests/fork11/utils.go | 14 +++++++++++++- tests/tx_helpers.go | 19 +++++++++++++++++++ 5 files changed, 90 insertions(+), 12 deletions(-) diff --git a/builtin/fork11_upgrades.go b/builtin/fork11_upgrades.go index f31aaac9..f531827e 100644 --- a/builtin/fork11_upgrades.go +++ b/builtin/fork11_upgrades.go @@ -5,7 +5,12 @@ var ( // fork 11: upgrade USDC.eth, USDT.eth and WBTC.eth to add `permit` function // ---------------------------------- // ERC20MinterBurnerPauserPermit: added `permit` function on ERC20MinterBurnerPauser - ERC20MinterBurnerPauserPermit_ABI = convertABI(`[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CACHED_CHAIN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CACHED_DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CACHED_THIS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CONST_PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HASHED_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HASHED_VERSION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_TYPE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}] -`) - ERC20MinterBurnerPauserPermit_DeployedBytecode = convertBytecode("0x608060405234801561001057600080fd5b50600436106102275760003560e01c8063712ac56d11610130578063a457c2d7116100b8578063d53913931161007c578063d5391393146106c6578063d547741f146106ce578063da28b527146106fa578063dd62ed3e14610702578063e63ab1e91461073057610227565b8063a457c2d714610641578063a9059cbb1461066d578063a9e91e5414610699578063ca15c873146106a1578063caac6c82146106be57610227565b80639010d07c116100ff5780639010d07c146104fb57806391d148541461053a57806395d89b41146105665780639fd5a6cf1461056e578063a217fddf1461063957610227565b8063712ac56d1461049957806379cc6790146104a15780637ecebe00146104cd5780638456cb59146104f357610227565b80633644e515116101b357806340c10f191161018257806340c10f191461041a57806342966c68146104465780635c975abb146104635780635d2dab0b1461046b57806370a082311461047357610227565b80633644e515146103b257806336568abe146103ba57806339509351146103e65780633f4ba83a1461041257610227565b8063248a9ca3116101fa578063248a9ca3146103395780632b437d48146103565780632f2ff15d1461035e578063313ce5671461038c57806334f9d406146103aa57610227565b806306fdde031461022c578063095ea7b3146102a957806318160ddd146102e957806323b872dd14610303575b600080fd5b610234610738565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561026e578181015183820152602001610256565b50505050905090810190601f16801561029b5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102d5600480360360408110156102bf57600080fd5b506001600160a01b0381351690602001356107cf565b604080519115158252519081900360200190f35b6102f16107ed565b60408051918252519081900360200190f35b6102d56004803603606081101561031957600080fd5b506001600160a01b038135811691602081013590911690604001356107f3565b6102f16004803603602081101561034f57600080fd5b503561087a565b6102f161088f565b61038a6004803603604081101561037457600080fd5b50803590602001356001600160a01b0316610894565b005b610394610900565b6040805160ff9092168252519081900360200190f35b6102f1610909565b6102f161092d565b61038a600480360360408110156103d057600080fd5b50803590602001356001600160a01b031661093c565b6102d5600480360360408110156103fc57600080fd5b506001600160a01b03813516906020013561099d565b61038a6109eb565b61038a6004803603604081101561043057600080fd5b506001600160a01b038135169060200135610a5c565b61038a6004803603602081101561045c57600080fd5b5035610acd565b6102d5610ae1565b6102f1610aef565b6102f16004803603602081101561048957600080fd5b50356001600160a01b0316610b13565b6102f1610b2e565b61038a600480360360408110156104b757600080fd5b506001600160a01b038135169060200135610b52565b6102f1600480360360208110156104e357600080fd5b50356001600160a01b0316610bac565b61038a610bcd565b61051e6004803603604081101561051157600080fd5b5080359060200135610c3c565b604080516001600160a01b039092168252519081900360200190f35b6102d56004803603604081101561055057600080fd5b50803590602001356001600160a01b0316610c5b565b610234610c73565b61038a600480360360a081101561058457600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a0810160808201356401000000008111156105c457600080fd5b8201836020820111156105d657600080fd5b803590602001918460018302840111640100000000831117156105f857600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610cd4945050505050565b6102f1610e4c565b6102d56004803603604081101561065757600080fd5b506001600160a01b038135169060200135610e51565b6102d56004803603604081101561068357600080fd5b506001600160a01b038135169060200135610eb9565b6102f1610ecd565b6102f1600480360360208110156106b757600080fd5b5035610ef1565b6102f1610f08565b6102f1610f2c565b61038a600480360360408110156106e457600080fd5b50803590602001356001600160a01b0316610f50565b61051e610fa9565b6102f16004803603604081101561071857600080fd5b506001600160a01b0381358116916020013516610fc1565b6102f1610fec565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107c45780601f10610799576101008083540402835291602001916107c4565b820191906000526020600020905b8154815290600101906020018083116107a757829003601f168201915b505050505090505b90565b60006107e36107dc611025565b8484611029565b5060015b92915050565b60035490565b6000610800848484611115565b6108708461080c611025565b61086b85604051806060016040528060288152602001611f50602891396001600160a01b038a1660009081526002602052604081209061084a611025565b6001600160a01b031681526020810191909152604001600020549190611272565b611029565b5060019392505050565b60009081526020819052604090206002015490565b605281565b6000828152602081905260409020600201546108b7906108b2611025565b610c5b565b6108f25760405162461bcd60e51b815260040180806020018281038252602f815260200180611e2c602f913960400191505060405180910390fd5b6108fc8282611309565b5050565b60065460ff1690565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b6000610937611372565b905090565b610944611025565b6001600160a01b0316816001600160a01b0316146109935760405162461bcd60e51b815260040180806020018281038252602f815260200180612098602f913960400191505060405180910390fd5b6108fc828261143c565b60006107e36109aa611025565b8461086b85600260006109bb611025565b6001600160a01b03908116825260208083019390935260409182016000908120918c1681529252902054906114a5565b610a177f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6108b2611025565b610a525760405162461bcd60e51b8152600401808060200182810382526039815260200180611e7d6039913960400191505060405180910390fd5b610a5a6114ff565b565b610a887f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a66108b2611025565b610ac35760405162461bcd60e51b8152600401808060200182810382526036815260200180611f786036913960400191505060405180910390fd5b6108fc82826115a0565b610ade610ad8611025565b82611692565b50565b600654610100900460ff1690565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6001600160a01b031660009081526001602052604090205490565b7fe8245ed8f93ccf147bc8972ab6d5f8278ed994d647700daaa5b7ebde9370aa6f81565b6000610b8982604051806060016040528060248152602001611fae60249139610b8286610b7d611025565b610fc1565b9190611272565b9050610b9d83610b97611025565b83611029565b610ba78383611692565b505050565b6001600160a01b03811660009081526007602052604081206107e79061178e565b610bf97f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a6108b2611025565b610c345760405162461bcd60e51b815260040180806020018281038252603781526020018061203c6037913960400191505060405180910390fd5b610a5a611792565b6000828152602081905260408120610c549083611817565b9392505050565b6000828152602081905260408120610c549083611823565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107c45780601f10610799576101008083540402835291602001916107c4565b81421115610d29576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9868686610d5883611838565b8760405160200180878152602001866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040528051906020012090506000610dc18261186a565b90506000610dcf828561187d565b9050876001600160a01b0316816001600160a01b031614610e37576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b610e42888888611029565b5050505050505050565b600081565b60006107e3610e5e611025565b8461086b856040518060600160405280602581526020016120736025913960026000610e88611025565b6001600160a01b03908116825260208083019390935260409182016000908120918d16815292529020549190611272565b60006107e3610ec6611025565b8484611115565b7f5d0a451daeda5bd9f4095b6c09da34bdf3b91f4b8b8f60e3dd42d9d0d1ed158481565b60008181526020819052604081206107e7906118a1565b7f5e422fe6c718eb4b17d6b107d0b546cf8641493faaaddb68e483cd686c1d756c81565b7f9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a681565b600082815260208190526040902060020154610f6e906108b2611025565b6109935760405162461bcd60e51b8152600401808060200182810382526030815260200180611f206030913960400191505060405180910390fd5b73228ebbee999c6a7ad74a6130e81b12f9fe237ba381565b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b7f65d7a28e3265b37a6474929f336521b332c1681b933f6cb9f3376673440d862a81565b6000610c54836001600160a01b0384166118ac565b3390565b6001600160a01b03831661106e5760405162461bcd60e51b81526004018080602001828103825260248152602001806120186024913960400191505060405180910390fd5b6001600160a01b0382166110b35760405162461bcd60e51b8152600401808060200182810382526022815260200180611eb66022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b03831661115a5760405162461bcd60e51b8152600401808060200182810382526025815260200180611ff36025913960400191505060405180910390fd5b6001600160a01b03821661119f5760405162461bcd60e51b8152600401808060200182810382526023815260200180611e096023913960400191505060405180910390fd5b6111aa8383836118f6565b6111e781604051806060016040528060268152602001611ed8602691396001600160a01b0386166000908152600160205260409020549190611272565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461121690826114a5565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113015760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112c65781810151838201526020016112ae565b50505050905090810190601f1680156112f35780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008281526020819052604090206113219082611010565b156108fc5761132e611025565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60003073228ebbee999c6a7ad74a6130e81b12f9fe237ba314801561139e5750605261139c611901565b145b156113ca57507f5d0a451daeda5bd9f4095b6c09da34bdf3b91f4b8b8f60e3dd42d9d0d1ed15846107cc565b6114357f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f5e422fe6c718eb4b17d6b107d0b546cf8641493faaaddb68e483cd686c1d756c7fe8245ed8f93ccf147bc8972ab6d5f8278ed994d647700daaa5b7ebde9370aa6f611905565b90506107cc565b60008281526020819052604090206114549082611967565b156108fc57611461611025565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610c54576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b611507610ae1565b61154f576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6006805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611583611025565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b0382166115fb576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b611607600083836118f6565b60035461161490826114a5565b6003556001600160a01b03821660009081526001602052604090205461163a90826114a5565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166116d75760405162461bcd60e51b8152600401808060200182810382526021815260200180611fd26021913960400191505060405180910390fd5b6116e3826000836118f6565b61172081604051806060016040528060228152602001611e5b602291396001600160a01b0385166000908152600160205260409020549190611272565b6001600160a01b038316600090815260016020526040902055600354611746908261197c565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b61179a610ae1565b156117df576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6006805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258611583611025565b6000610c5483836119d9565b6000610c54836001600160a01b038416611a3d565b6001600160a01b03811660009081526007602052604081206118598161178e565b915061186481611a55565b50919050565b60006107e7611877611372565b83611a5e565b600080600061188c8585611a99565b9150915061189981611adf565b509392505050565b60006107e78261178e565b60006118b88383611a3d565b6118ee575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556107e7565b5060006107e7565b610ba7838383611c05565b4690565b6000838383611912611901565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b6000610c54836001600160a01b038416611c54565b6000828211156119d3576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b81546000908210611a1b5760405162461bcd60e51b8152600401808060200182810382526022815260200180611de76022913960400191505060405180910390fd5b826000018281548110611a2a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b80546001019055565b6040805161190160f01b6020808301919091526022820194909452604280820193909352815180820390930183526062019052805191012090565b600080825160411415611ad05760208301516040840151606085015160001a611ac487828585611d1a565b94509450505050611ad8565b506000905060025b9250929050565b6000816004811115611aed57fe5b1415611af857610ade565b6001816004811115611b0657fe5b1415611b59576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b6002816004811115611b6757fe5b1415611bba576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b6003816004811115611bc857fe5b1415610ade5760405162461bcd60e51b8152600401808060200182810382526022815260200180611efe6022913960400191505060405180910390fd5b611c10838383610ba7565b611c18610ae1565b15610ba75760405162461bcd60e51b815260040180806020018281038252602a8152602001806120c7602a913960400191505060405180910390fd5b60008181526001830160205260408120548015611d105783546000198083019190810190600090879083908110611c8757fe5b9060005260206000200154905080876000018481548110611ca457fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611cd457fe5b600190038181906000526020600020016000905590558660010160008781526020019081526020016000206000905560019450505050506107e7565b60009150506107e7565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d515750600090506003611ddd565b600060018787878760405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa158015611dad573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611dd657600060019250925050611ddd565b9150600090505b9450949250505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20756e706175736545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332305072657365744d696e7465725061757365723a206d7573742068617665206d696e74657220726f6c6520746f206d696e7445524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20706175736545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c6645524332305061757361626c653a20746f6b656e207472616e73666572207768696c6520706175736564a2646970667358221220c02119084d35bbf9feb9fe0028ad6174b270b3d055220da0a97645b48cb3c1ef64736f6c63430007000033") + ERC20MinterBurnerPauserPermit_ABI = convertABI(`[{"inputs":[{"internalType":"string","name":"_name","type":"string"},{"internalType":"string","name":"_symbol","type":"string"},{"internalType":"uint8","name":"decimals_","type":"uint8"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"spender","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Paused","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"Transfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"account","type":"address"}],"name":"Unpaused","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MINTER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"PAUSER_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CACHED_CHAIN_ID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_CACHED_DOMAIN_SEPARATOR","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HASHED_NAME","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_HASHED_VERSION","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_PERMIT_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"_TYPE_HASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"typeHash","type":"bytes32"},{"internalType":"bytes32","name":"nameHash","type":"bytes32"},{"internalType":"bytes32","name":"versionHash","type":"bytes32"}],"name":"_buildDomainSeparator","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"}],"name":"allowance","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"approve","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burn","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"burnFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"decimals","outputs":[{"internalType":"uint8","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"subtractedValue","type":"uint256"}],"name":"decreaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getChainID","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"uint256","name":"index","type":"uint256"}],"name":"getRoleMember","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleMemberCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"addedValue","type":"uint256"}],"name":"increaseAllowance","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mint","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"}],"name":"nonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"paused","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"spender","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"permit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"symbol","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transfer","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"transferFrom","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"}]`) + + USDCEthV2_DeployedBytecode = convertBytecode("0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063712ac56d11610130578063a217fddf116100b8578063caac6c821161007c578063caac6c82146106fa578063d539139314610702578063d547741f1461070a578063dd62ed3e14610736578063e63ab1e91461076457610232565b8063a217fddf14610675578063a457c2d71461067d578063a9059cbb146106a9578063a9e91e54146106d5578063ca15c873146106dd57610232565b80639010d07c116100ff5780639010d07c1461052f57806391d148541461056e57806395d89b411461059a578063982aaf6b146105a25780639fd5a6cf146105aa57610232565b8063712ac56d146104cd57806379cc6790146104d55780637ecebe00146105015780638456cb591461052757610232565b80633644e515116101be57806342966c681161018257806342966c6814610472578063564b81ef1461048f5780635c975abb146104975780635d2dab0b1461049f57806370a08231146104a757610232565b80633644e515146103de57806336568abe146103e657806339509351146104125780633f4ba83a1461043e57806340c10f191461044657610232565b806323b872dd1161020557806323b872dd14610337578063248a9ca31461036d5780632b437d481461038a5780632f2ff15d14610392578063313ce567146103c057610232565b806306fdde0314610237578063095ea7b3146102b4578063112794f2146102f457806318160ddd1461032f575b600080fd5b61023f61076c565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e0600480360360408110156102ca57600080fd5b506001600160a01b038135169060200135610802565b604080519115158252519081900360200190f35b61031d6004803603606081101561030a57600080fd5b5080359060208101359060400135610820565b60408051918252519081900360200190f35b61031d610876565b6102e06004803603606081101561034d57600080fd5b506001600160a01b0381358116916020810135909116906040013561087c565b61031d6004803603602081101561038357600080fd5b5035610909565b61031d61091e565b6103be600480360360408110156103a857600080fd5b50803590602001356001600160a01b0316610923565b005b6103c861098f565b6040805160ff9092168252519081900360200190f35b61031d610998565b6103be600480360360408110156103fc57600080fd5b50803590602001356001600160a01b03166109bc565b6102e06004803603604081101561042857600080fd5b506001600160a01b038135169060200135610a1d565b6103be610a71565b6103be6004803603604081101561045c57600080fd5b506001600160a01b038135169060200135610ae2565b6103be6004803603602081101561048857600080fd5b5035610b53565b61031d610b67565b6102e0610b6b565b61031d610b79565b61031d600480360360208110156104bd57600080fd5b50356001600160a01b0316610b9d565b61031d610bb8565b6103be600480360360408110156104eb57600080fd5b506001600160a01b038135169060200135610bdc565b61031d6004803603602081101561051757600080fd5b50356001600160a01b0316610c3c565b6103be610c5d565b6105526004803603604081101561054557600080fd5b5080359060200135610ccc565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603604081101561058457600080fd5b50803590602001356001600160a01b0316610cf1565b61023f610d0f565b61031d610d70565b6103be600480360360a08110156105c057600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a08101608082013564010000000081111561060057600080fd5b82018360208201111561061257600080fd5b8035906020019184600183028401116401000000008311171561063457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d94945050505050565b61031d610f01565b6102e06004803603604081101561069357600080fd5b506001600160a01b038135169060200135610f06565b6102e0600480360360408110156106bf57600080fd5b506001600160a01b038135169060200135610f74565b61031d610f88565b61031d600480360360208110156106f357600080fd5b5035610fac565b61031d610fc3565b61031d610fe7565b6103be6004803603604081101561072057600080fd5b50803590602001356001600160a01b031661100a565b61031d6004803603604081101561074c57600080fd5b506001600160a01b0381358116916020013516611063565b61031d61108e565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f85780601f106107cd576101008083540402835291602001916107f8565b820191906000526020600020905b8154815290600101906020018083116107db57829003601f168201915b5050505050905090565b600061081661080f6110b1565b84846110b5565b5060015b92915050565b600083838361082d610b67565b6040805160208082019690965280820194909452606084019290925260808301523060a0808401919091528151808403909101815260c090920190528051910120949350505050565b60035490565b60006108898484846111a1565b6108ff846108956110b1565b6108fa85604051806060016040528060288152602001611f06602891396001600160a01b038a166000908152600260205260408120906108d36110b1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61130a16565b6110b5565b5060019392505050565b60009081526020819052604090206002015490565b605281565b600082815260208190526040902060020154610946906109416110b1565b610cf1565b6109815760405162461bcd60e51b815260040180806020018281038252602f815260200180611de2602f913960400191505060405180910390fd5b61098b82826113a1565b5050565b60065460ff1690565b7fcc5d768f169e6432833fe8c546fccdd39910a37ad40de79d7fa9abd15e8c14f190565b6109c46110b1565b6001600160a01b0316816001600160a01b031614610a135760405162461bcd60e51b815260040180806020018281038252602f81526020018061204e602f913960400191505060405180910390fd5b61098b8282611410565b6000610816610a2a6110b1565b846108fa8560026000610a3b6110b1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61147f16565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610a9d906109416110b1565b610ad85760405162461bcd60e51b8152600401808060200182810382526039815260200180611e336039913960400191505060405180910390fd5b610ae06114d9565b565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b019020610b0e906109416110b1565b610b495760405162461bcd60e51b8152600401808060200182810382526036815260200180611f2e6036913960400191505060405180910390fd5b61098b828261157a565b610b64610b5e6110b1565b82611678565b50565b4690565b600654610100900460ff1690565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6001600160a01b031660009081526001602052604090205490565b7fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b381565b6000610c1982604051806060016040528060248152602001611f6460249139610c0c86610c076110b1565b611063565b919063ffffffff61130a16565b9050610c2d83610c276110b1565b836110b5565b610c378383611678565b505050565b6001600160a01b038116600090815260076020526040812061081a90611780565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610c89906109416110b1565b610cc45760405162461bcd60e51b8152600401808060200182810382526037815260200180611ff26037913960400191505060405180910390fd5b610ae0611784565b6000828152602081905260408120610cea908363ffffffff61180916565b9392505050565b6000828152602081905260408120610cea908363ffffffff61181516565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f85780601f106107cd576101008083540402835291602001916107f8565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b81421115610de9576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9868686610e188361182a565b604080516020808201979097526001600160a01b0395861681830152939094166060840152608083019190915260a082015260c08082018790528251808303909101815260e0909101909152805191012090506000610e768261185c565b90506000610e848285611888565b9050876001600160a01b0316816001600160a01b031614610eec576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b610ef78888886110b5565b5050505050505050565b600081565b6000610816610f136110b1565b846108fa856040518060600160405280602581526020016120296025913960026000610f3d6110b1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61130a16565b6000610816610f816110b1565b84846111a1565b7fcc5d768f169e6432833fe8c546fccdd39910a37ad40de79d7fa9abd15e8c14f181565b600081815260208190526040812061081a906118ac565b7f25a4d738922a372a8c250edc3e5732cdc7fbb2b353145c5efcd2aa1038f753fe81565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b01902081565b600082815260208190526040902060020154611028906109416110b1565b610a135760405162461bcd60e51b8152600401808060200182810382526030815260200180611ed66030913960400191505060405180910390fd5b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b604080516a5041555345525f524f4c4560a81b8152905190819003600b01902081565b3390565b6001600160a01b0383166110fa5760405162461bcd60e51b8152600401808060200182810382526024815260200180611fce6024913960400191505060405180910390fd5b6001600160a01b03821661113f5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e6c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166111e65760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa96025913960400191505060405180910390fd5b6001600160a01b03821661122b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611dbf6023913960400191505060405180910390fd5b6112368383836118b7565b61127981604051806060016040528060268152602001611e8e602691396001600160a01b038616600090815260016020526040902054919063ffffffff61130a16565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546112ae908263ffffffff61147f16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561135e578181015183820152602001611346565b50505050905090810190601f16801561138b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008281526020819052604090206113bf908263ffffffff6118c216565b1561098b576113cc6110b1565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260208190526040902061142e908263ffffffff6118d716565b1561098b5761143b6110b1565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610cea576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6114e1610b6b565b611529576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6006805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61155d6110b1565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b0382166115d5576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6115e1600083836118b7565b6003546115f4908263ffffffff61147f16565b6003556001600160a01b038216600090815260016020526040902054611620908263ffffffff61147f16565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166116bd5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f886021913960400191505060405180910390fd5b6116c9826000836118b7565b61170c81604051806060016040528060228152602001611e11602291396001600160a01b038516600090815260016020526040902054919063ffffffff61130a16565b6001600160a01b038316600090815260016020526040902055600354611738908263ffffffff6118ec16565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b61178c610b6b565b156117d1576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6006805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861155d6110b1565b6000610cea8383611949565b6000610cea836001600160a01b0384166119ad565b6001600160a01b038116600090815260076020526040812061184b81611780565b9150611856816119c5565b50919050565b600061081a7fcc5d768f169e6432833fe8c546fccdd39910a37ad40de79d7fa9abd15e8c14f1836119ce565b60008060006118978585611a09565b915091506118a481611a4f565b509392505050565b600061081a82611780565b610c37838383611b75565b6000610cea836001600160a01b038416611bc4565b6000610cea836001600160a01b038416611c0e565b600082821115611943576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b8154600090821061198b5760405162461bcd60e51b8152600401808060200182810382526022815260200180611d9d6022913960400191505060405180910390fd5b82600001828154811061199a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b80546001019055565b6040805161190160f01b6020808301919091526022820194909452604280820193909352815180820390930183526062019052805191012090565b600080825160411415611a405760208301516040840151606085015160001a611a3487828585611cd4565b94509450505050611a48565b506000905060025b9250929050565b6000816004811115611a5d57fe5b1415611a6857610b64565b6001816004811115611a7657fe5b1415611ac9576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b6002816004811115611ad757fe5b1415611b2a576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b6003816004811115611b3857fe5b1415610b645760405162461bcd60e51b8152600401808060200182810382526022815260200180611eb46022913960400191505060405180910390fd5b611b80838383610c37565b611b88610b6b565b15610c375760405162461bcd60e51b815260040180806020018281038252602a81526020018061207d602a913960400191505060405180910390fd5b6000611bd083836119ad565b611c065750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081a565b50600061081a565b60008181526001830160205260408120548015611cca5783546000198083019190810190600090879083908110611c4157fe5b9060005260206000200154905080876000018481548110611c5e57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611c8e57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061081a565b600091505061081a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d0b5750600090506003611d93565b60408051600080825260208083018085528a905260ff89168385015260608301889052608083018790529251909260019260a080820193601f1981019281900390910190855afa158015611d63573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d8c57506000915060019050611d93565b9150600090505b9450949250505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20756e706175736545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332305072657365744d696e7465725061757365723a206d7573742068617665206d696e74657220726f6c6520746f206d696e7445524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20706175736545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c6645524332305061757361626c653a20746f6b656e207472616e73666572207768696c6520706175736564a26469706673582212203852ad2213ecea5dfc26f8b50a7e2d1ef6ddaf66f862c6ba259d33cbae69c8aa64736f6c63430006040033") + + + USDTEthV2_DeployedBytecode = convertBytecode("0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063712ac56d11610130578063a217fddf116100b8578063caac6c821161007c578063caac6c82146106fa578063d539139314610702578063d547741f1461070a578063dd62ed3e14610736578063e63ab1e91461076457610232565b8063a217fddf14610675578063a457c2d71461067d578063a9059cbb146106a9578063a9e91e54146106d5578063ca15c873146106dd57610232565b80639010d07c116100ff5780639010d07c1461052f57806391d148541461056e57806395d89b411461059a578063982aaf6b146105a25780639fd5a6cf146105aa57610232565b8063712ac56d146104cd57806379cc6790146104d55780637ecebe00146105015780638456cb591461052757610232565b80633644e515116101be57806342966c681161018257806342966c6814610472578063564b81ef1461048f5780635c975abb146104975780635d2dab0b1461049f57806370a08231146104a757610232565b80633644e515146103de57806336568abe146103e657806339509351146104125780633f4ba83a1461043e57806340c10f191461044657610232565b806323b872dd1161020557806323b872dd14610337578063248a9ca31461036d5780632b437d481461038a5780632f2ff15d14610392578063313ce567146103c057610232565b806306fdde0314610237578063095ea7b3146102b4578063112794f2146102f457806318160ddd1461032f575b600080fd5b61023f61076c565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e0600480360360408110156102ca57600080fd5b506001600160a01b038135169060200135610802565b604080519115158252519081900360200190f35b61031d6004803603606081101561030a57600080fd5b5080359060208101359060400135610820565b60408051918252519081900360200190f35b61031d610876565b6102e06004803603606081101561034d57600080fd5b506001600160a01b0381358116916020810135909116906040013561087c565b61031d6004803603602081101561038357600080fd5b5035610909565b61031d61091e565b6103be600480360360408110156103a857600080fd5b50803590602001356001600160a01b0316610923565b005b6103c861098f565b6040805160ff9092168252519081900360200190f35b61031d610998565b6103be600480360360408110156103fc57600080fd5b50803590602001356001600160a01b03166109bc565b6102e06004803603604081101561042857600080fd5b506001600160a01b038135169060200135610a1d565b6103be610a71565b6103be6004803603604081101561045c57600080fd5b506001600160a01b038135169060200135610ae2565b6103be6004803603602081101561048857600080fd5b5035610b53565b61031d610b67565b6102e0610b6b565b61031d610b79565b61031d600480360360208110156104bd57600080fd5b50356001600160a01b0316610b9d565b61031d610bb8565b6103be600480360360408110156104eb57600080fd5b506001600160a01b038135169060200135610bdc565b61031d6004803603602081101561051757600080fd5b50356001600160a01b0316610c3c565b6103be610c5d565b6105526004803603604081101561054557600080fd5b5080359060200135610ccc565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603604081101561058457600080fd5b50803590602001356001600160a01b0316610cf1565b61023f610d0f565b61031d610d70565b6103be600480360360a08110156105c057600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a08101608082013564010000000081111561060057600080fd5b82018360208201111561061257600080fd5b8035906020019184600183028401116401000000008311171561063457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d94945050505050565b61031d610f01565b6102e06004803603604081101561069357600080fd5b506001600160a01b038135169060200135610f06565b6102e0600480360360408110156106bf57600080fd5b506001600160a01b038135169060200135610f74565b61031d610f88565b61031d600480360360208110156106f357600080fd5b5035610fac565b61031d610fc3565b61031d610fe7565b6103be6004803603604081101561072057600080fd5b50803590602001356001600160a01b031661100a565b61031d6004803603604081101561074c57600080fd5b506001600160a01b0381358116916020013516611063565b61031d61108e565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f85780601f106107cd576101008083540402835291602001916107f8565b820191906000526020600020905b8154815290600101906020018083116107db57829003601f168201915b5050505050905090565b600061081661080f6110b1565b84846110b5565b5060015b92915050565b600083838361082d610b67565b6040805160208082019690965280820194909452606084019290925260808301523060a0808401919091528151808403909101815260c090920190528051910120949350505050565b60035490565b60006108898484846111a1565b6108ff846108956110b1565b6108fa85604051806060016040528060288152602001611f06602891396001600160a01b038a166000908152600260205260408120906108d36110b1565b6001600160a01b03168152602081019190915260400160002054919063ffffffff61130a16565b6110b5565b5060019392505050565b60009081526020819052604090206002015490565b605281565b600082815260208190526040902060020154610946906109416110b1565b610cf1565b6109815760405162461bcd60e51b815260040180806020018281038252602f815260200180611de2602f913960400191505060405180910390fd5b61098b82826113a1565b5050565b60065460ff1690565b7fa3144afa2af7ddb3eb23e9953c4db92d25b34125d58673bd0bf3f668da7d4b6690565b6109c46110b1565b6001600160a01b0316816001600160a01b031614610a135760405162461bcd60e51b815260040180806020018281038252602f81526020018061204e602f913960400191505060405180910390fd5b61098b8282611410565b6000610816610a2a6110b1565b846108fa8560026000610a3b6110b1565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61147f16565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610a9d906109416110b1565b610ad85760405162461bcd60e51b8152600401808060200182810382526039815260200180611e336039913960400191505060405180910390fd5b610ae06114d9565b565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b019020610b0e906109416110b1565b610b495760405162461bcd60e51b8152600401808060200182810382526036815260200180611f2e6036913960400191505060405180910390fd5b61098b828261157a565b610b64610b5e6110b1565b82611678565b50565b4690565b600654610100900460ff1690565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6001600160a01b031660009081526001602052604090205490565b7fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b381565b6000610c1982604051806060016040528060248152602001611f6460249139610c0c86610c076110b1565b611063565b919063ffffffff61130a16565b9050610c2d83610c276110b1565b836110b5565b610c378383611678565b505050565b6001600160a01b038116600090815260076020526040812061081a90611780565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610c89906109416110b1565b610cc45760405162461bcd60e51b8152600401808060200182810382526037815260200180611ff26037913960400191505060405180910390fd5b610ae0611784565b6000828152602081905260408120610cea908363ffffffff61180916565b9392505050565b6000828152602081905260408120610cea908363ffffffff61181516565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f85780601f106107cd576101008083540402835291602001916107f8565b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c981565b81421115610de9576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9868686610e188361182a565b604080516020808201979097526001600160a01b0395861681830152939094166060840152608083019190915260a082015260c08082018790528251808303909101815260e0909101909152805191012090506000610e768261185c565b90506000610e848285611888565b9050876001600160a01b0316816001600160a01b031614610eec576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b610ef78888886110b5565b5050505050505050565b600081565b6000610816610f136110b1565b846108fa856040518060600160405280602581526020016120296025913960026000610f3d6110b1565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff61130a16565b6000610816610f816110b1565b84846111a1565b7fa3144afa2af7ddb3eb23e9953c4db92d25b34125d58673bd0bf3f668da7d4b6681565b600081815260208190526040812061081a906118ac565b7f25a4d738922a372a8c250edc3e5732cdc7fbb2b353145c5efcd2aa1038f753fe81565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b01902081565b600082815260208190526040902060020154611028906109416110b1565b610a135760405162461bcd60e51b8152600401808060200182810382526030815260200180611ed66030913960400191505060405180910390fd5b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b604080516a5041555345525f524f4c4560a81b8152905190819003600b01902081565b3390565b6001600160a01b0383166110fa5760405162461bcd60e51b8152600401808060200182810382526024815260200180611fce6024913960400191505060405180910390fd5b6001600160a01b03821661113f5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e6c6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166111e65760405162461bcd60e51b8152600401808060200182810382526025815260200180611fa96025913960400191505060405180910390fd5b6001600160a01b03821661122b5760405162461bcd60e51b8152600401808060200182810382526023815260200180611dbf6023913960400191505060405180910390fd5b6112368383836118b7565b61127981604051806060016040528060268152602001611e8e602691396001600160a01b038616600090815260016020526040902054919063ffffffff61130a16565b6001600160a01b0380851660009081526001602052604080822093909355908416815220546112ae908263ffffffff61147f16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113995760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b8381101561135e578181015183820152602001611346565b50505050905090810190601f16801561138b5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b60008281526020819052604090206113bf908263ffffffff6118c216565b1561098b576113cc6110b1565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b600082815260208190526040902061142e908263ffffffff6118d716565b1561098b5761143b6110b1565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610cea576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b6114e1610b6b565b611529576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6006805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa61155d6110b1565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b0382166115d5576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b6115e1600083836118b7565b6003546115f4908263ffffffff61147f16565b6003556001600160a01b038216600090815260016020526040902054611620908263ffffffff61147f16565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b0382166116bd5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f886021913960400191505060405180910390fd5b6116c9826000836118b7565b61170c81604051806060016040528060228152602001611e11602291396001600160a01b038516600090815260016020526040902054919063ffffffff61130a16565b6001600160a01b038316600090815260016020526040902055600354611738908263ffffffff6118ec16565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b61178c610b6b565b156117d1576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6006805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a25861155d6110b1565b6000610cea8383611949565b6000610cea836001600160a01b0384166119ad565b6001600160a01b038116600090815260076020526040812061184b81611780565b9150611856816119c5565b50919050565b600061081a7fa3144afa2af7ddb3eb23e9953c4db92d25b34125d58673bd0bf3f668da7d4b66836119ce565b60008060006118978585611a09565b915091506118a481611a4f565b509392505050565b600061081a82611780565b610c37838383611b75565b6000610cea836001600160a01b038416611bc4565b6000610cea836001600160a01b038416611c0e565b600082821115611943576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b8154600090821061198b5760405162461bcd60e51b8152600401808060200182810382526022815260200180611d9d6022913960400191505060405180910390fd5b82600001828154811061199a57fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b80546001019055565b6040805161190160f01b6020808301919091526022820194909452604280820193909352815180820390930183526062019052805191012090565b600080825160411415611a405760208301516040840151606085015160001a611a3487828585611cd4565b94509450505050611a48565b506000905060025b9250929050565b6000816004811115611a5d57fe5b1415611a6857610b64565b6001816004811115611a7657fe5b1415611ac9576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b6002816004811115611ad757fe5b1415611b2a576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b6003816004811115611b3857fe5b1415610b645760405162461bcd60e51b8152600401808060200182810382526022815260200180611eb46022913960400191505060405180910390fd5b611b80838383610c37565b611b88610b6b565b15610c375760405162461bcd60e51b815260040180806020018281038252602a81526020018061207d602a913960400191505060405180910390fd5b6000611bd083836119ad565b611c065750815460018181018455600084815260208082209093018490558454848252828601909352604090209190915561081a565b50600061081a565b60008181526001830160205260408120548015611cca5783546000198083019190810190600090879083908110611c4157fe5b9060005260206000200154905080876000018481548110611c5e57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611c8e57fe5b6001900381819060005260206000200160009055905586600101600087815260200190815260200160002060009055600194505050505061081a565b600091505061081a565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611d0b5750600090506003611d93565b60408051600080825260208083018085528a905260ff89168385015260608301889052608083018790529251909260019260a080820193601f1981019281900390910190855afa158015611d63573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d8c57506000915060019050611d93565b9150600090505b9450949250505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20756e706175736545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332305072657365744d696e7465725061757365723a206d7573742068617665206d696e74657220726f6c6520746f206d696e7445524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20706175736545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c6645524332305061757361626c653a20746f6b656e207472616e73666572207768696c6520706175736564a26469706673582212202ab0d58c2381e6feb6d7d15eb50e7da5ea9b1eadb978cf7e3c4cc7872eb1cfeb64736f6c63430006040033") + + WBTCEthV2_DeployedBytecode = convertBytecode("0x608060405234801561001057600080fd5b50600436106102325760003560e01c8063712ac56d11610130578063a217fddf116100b8578063caac6c821161007c578063caac6c82146106f2578063d5391393146106fa578063d547741f14610702578063dd62ed3e1461072e578063e63ab1e91461075c57610232565b8063a217fddf14610675578063a457c2d71461067d578063a9059cbb146106a9578063a9e91e54146105a2578063ca15c873146106d557610232565b80639010d07c116100ff5780639010d07c1461052f57806391d148541461056e57806395d89b411461059a578063982aaf6b146105a25780639fd5a6cf146105aa57610232565b8063712ac56d146104cd57806379cc6790146104d55780637ecebe00146105015780638456cb591461052757610232565b80633644e515116101be57806342966c681161018257806342966c6814610472578063564b81ef1461048f5780635c975abb146104975780635d2dab0b1461049f57806370a08231146104a757610232565b80633644e515146103de57806336568abe146103e657806339509351146104125780633f4ba83a1461043e57806340c10f191461044657610232565b806323b872dd1161020557806323b872dd14610337578063248a9ca31461036d5780632b437d481461038a5780632f2ff15d14610392578063313ce567146103c057610232565b806306fdde0314610237578063095ea7b3146102b4578063112794f2146102f457806318160ddd1461032f575b600080fd5b61023f610764565b6040805160208082528351818301528351919283929083019185019080838360005b83811015610279578181015183820152602001610261565b50505050905090810190601f1680156102a65780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6102e0600480360360408110156102ca57600080fd5b506001600160a01b0381351690602001356107fa565b604080519115158252519081900360200190f35b61031d6004803603606081101561030a57600080fd5b5080359060208101359060400135610818565b60408051918252519081900360200190f35b61031d61086e565b6102e06004803603606081101561034d57600080fd5b506001600160a01b03813581169160208101359091169060400135610874565b61031d6004803603602081101561038357600080fd5b5035610901565b61031d610916565b6103be600480360360408110156103a857600080fd5b50803590602001356001600160a01b031661091b565b005b6103c8610987565b6040805160ff9092168252519081900360200190f35b61031d610990565b6103be600480360360408110156103fc57600080fd5b50803590602001356001600160a01b03166109a2565b6102e06004803603604081101561042857600080fd5b506001600160a01b038135169060200135610a03565b6103be610a57565b6103be6004803603604081101561045c57600080fd5b506001600160a01b038135169060200135610ac8565b6103be6004803603602081101561048857600080fd5b5035610b39565b61031d610b4d565b6102e0610b51565b61031d610b5f565b61031d600480360360208110156104bd57600080fd5b50356001600160a01b0316610b83565b61031d610b9e565b6103be600480360360408110156104eb57600080fd5b506001600160a01b038135169060200135610bc2565b61031d6004803603602081101561051757600080fd5b50356001600160a01b0316610c22565b6103be610c43565b6105526004803603604081101561054557600080fd5b5080359060200135610cb2565b604080516001600160a01b039092168252519081900360200190f35b6102e06004803603604081101561058457600080fd5b50803590602001356001600160a01b0316610cd7565b61023f610cf5565b61031d610d56565b6103be600480360360a08110156105c057600080fd5b6001600160a01b03823581169260208101359091169160408201359160608101359181019060a08101608082013564010000000081111561060057600080fd5b82018360208201111561061257600080fd5b8035906020019184600183028401116401000000008311171561063457600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610d68945050505050565b61031d610ec3565b6102e06004803603604081101561069357600080fd5b506001600160a01b038135169060200135610ec8565b6102e0600480360360408110156106bf57600080fd5b506001600160a01b038135169060200135610f36565b61031d600480360360208110156106eb57600080fd5b5035610f4a565b61031d610f61565b61031d610f85565b6103be6004803603604081101561071857600080fd5b50803590602001356001600160a01b0316610fa8565b61031d6004803603604081101561074457600080fd5b506001600160a01b0381358116916020013516611001565b61031d61102c565b60048054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f05780601f106107c5576101008083540402835291602001916107f0565b820191906000526020600020905b8154815290600101906020018083116107d357829003601f168201915b5050505050905090565b600061080e61080761104f565b8484611053565b5060015b92915050565b6000838383610825610b4d565b6040805160208082019690965280820194909452606084019290925260808301523060a0808401919091528151808403909101815260c090920190528051910120949350505050565b60035490565b600061088184848461113f565b6108f78461088d61104f565b6108f285604051806060016040528060288152602001611e92602891396001600160a01b038a166000908152600260205260408120906108cb61104f565b6001600160a01b03168152602081019190915260400160002054919063ffffffff6112a816565b611053565b5060019392505050565b60009081526020819052604090206002015490565b605281565b60008281526020819052604090206002015461093e9061093961104f565b610cd7565b6109795760405162461bcd60e51b815260040180806020018281038252602f815260200180611d6e602f913960400191505060405180910390fd5b610983828261133f565b5050565b60065460ff1690565b600080516020611f3583398151915290565b6109aa61104f565b6001600160a01b0316816001600160a01b0316146109f95760405162461bcd60e51b815260040180806020018281038252602f815260200180611ffa602f913960400191505060405180910390fd5b61098382826113ae565b600061080e610a1061104f565b846108f28560026000610a2161104f565b6001600160a01b03908116825260208083019390935260409182016000908120918c16815292529020549063ffffffff61141d16565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610a839061093961104f565b610abe5760405162461bcd60e51b8152600401808060200182810382526039815260200180611dbf6039913960400191505060405180910390fd5b610ac6611477565b565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b019020610af49061093961104f565b610b2f5760405162461bcd60e51b8152600401808060200182810382526036815260200180611eba6036913960400191505060405180910390fd5b6109838282611518565b610b4a610b4461104f565b82611616565b50565b4690565b600654610100900460ff1690565b7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81565b6001600160a01b031660009081526001602052604090205490565b7fe6bbd6277e1bf288eed5e8d1780f9a50b239e86b153736bceebccf4ea79d90b381565b6000610bff82604051806060016040528060248152602001611ef060249139610bf286610bed61104f565b611001565b919063ffffffff6112a816565b9050610c1383610c0d61104f565b83611053565b610c1d8383611616565b505050565b6001600160a01b03811660009081526007602052604081206108129061171e565b604080516a5041555345525f524f4c4560a81b8152905190819003600b019020610c6f9061093961104f565b610caa5760405162461bcd60e51b8152600401808060200182810382526037815260200180611f9e6037913960400191505060405180910390fd5b610ac6611722565b6000828152602081905260408120610cd0908363ffffffff6117a716565b9392505050565b6000828152602081905260408120610cd0908363ffffffff6117b316565b60058054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156107f05780601f106107c5576101008083540402835291602001916107f0565b600080516020611f3583398151915281565b81421115610dbd576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b6000600080516020611f35833981519152868686610dda836117c8565b604080516020808201979097526001600160a01b0395861681830152939094166060840152608083019190915260a082015260c08082018790528251808303909101815260e0909101909152805191012090506000610e38826117fa565b90506000610e468285611814565b9050876001600160a01b0316816001600160a01b031614610eae576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b610eb9888888611053565b5050505050505050565b600081565b600061080e610ed561104f565b846108f285604051806060016040528060258152602001611fd56025913960026000610eff61104f565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919063ffffffff6112a816565b600061080e610f4361104f565b848461113f565b600081815260208190526040812061081290611838565b7f25a4d738922a372a8c250edc3e5732cdc7fbb2b353145c5efcd2aa1038f753fe81565b604080516a4d494e5445525f524f4c4560a81b8152905190819003600b01902081565b600082815260208190526040902060020154610fc69061093961104f565b6109f95760405162461bcd60e51b8152600401808060200182810382526030815260200180611e626030913960400191505060405180910390fd5b6001600160a01b03918216600090815260026020908152604080832093909416825291909152205490565b604080516a5041555345525f524f4c4560a81b8152905190819003600b01902081565b3390565b6001600160a01b0383166110985760405162461bcd60e51b8152600401808060200182810382526024815260200180611f7a6024913960400191505060405180910390fd5b6001600160a01b0382166110dd5760405162461bcd60e51b8152600401808060200182810382526022815260200180611df86022913960400191505060405180910390fd5b6001600160a01b03808416600081815260026020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166111845760405162461bcd60e51b8152600401808060200182810382526025815260200180611f556025913960400191505060405180910390fd5b6001600160a01b0382166111c95760405162461bcd60e51b8152600401808060200182810382526023815260200180611d4b6023913960400191505060405180910390fd5b6111d4838383611843565b61121781604051806060016040528060268152602001611e1a602691396001600160a01b038616600090815260016020526040902054919063ffffffff6112a816565b6001600160a01b03808516600090815260016020526040808220939093559084168152205461124c908263ffffffff61141d16565b6001600160a01b0380841660008181526001602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156113375760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156112fc5781810151838201526020016112e4565b50505050905090810190601f1680156113295780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600082815260208190526040902061135d908263ffffffff61184e16565b156109835761136a61104f565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b60008281526020819052604090206113cc908263ffffffff61186316565b15610983576113d961104f565b6001600160a01b0316816001600160a01b0316837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45050565b600082820183811015610cd0576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b61147f610b51565b6114c7576040805162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015290519081900360640190fd5b6006805461ff00191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa6114fb61104f565b604080516001600160a01b039092168252519081900360200190a1565b6001600160a01b038216611573576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61157f60008383611843565b600354611592908263ffffffff61141d16565b6003556001600160a01b0382166000908152600160205260409020546115be908263ffffffff61141d16565b6001600160a01b03831660008181526001602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661165b5760405162461bcd60e51b8152600401808060200182810382526021815260200180611f146021913960400191505060405180910390fd5b61166782600083611843565b6116aa81604051806060016040528060228152602001611d9d602291396001600160a01b038516600090815260016020526040902054919063ffffffff6112a816565b6001600160a01b0383166000908152600160205260409020556003546116d6908263ffffffff61187816565b6003556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b61172a610b51565b1561176f576040805162461bcd60e51b815260206004820152601060248201526f14185d5cd8589b194e881c185d5cd95960821b604482015290519081900360640190fd5b6006805461ff0019166101001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586114fb61104f565b6000610cd083836118d5565b6000610cd0836001600160a01b038416611939565b6001600160a01b03811660009081526007602052604081206117e98161171e565b91506117f481611951565b50919050565b6000610812600080516020611f358339815191528361195a565b60008060006118238585611995565b91509150611830816119db565b509392505050565b60006108128261171e565b610c1d838383611b01565b6000610cd0836001600160a01b038416611b50565b6000610cd0836001600160a01b038416611b9a565b6000828211156118cf576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b815460009082106119175760405162461bcd60e51b8152600401808060200182810382526022815260200180611d296022913960400191505060405180910390fd5b82600001828154811061192657fe5b9060005260206000200154905092915050565b60009081526001919091016020526040902054151590565b80546001019055565b6040805161190160f01b6020808301919091526022820194909452604280820193909352815180820390930183526062019052805191012090565b6000808251604114156119cc5760208301516040840151606085015160001a6119c087828585611c60565b945094505050506119d4565b506000905060025b9250929050565b60008160048111156119e957fe5b14156119f457610b4a565b6001816004811115611a0257fe5b1415611a55576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b6002816004811115611a6357fe5b1415611ab6576040805162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015290519081900360640190fd5b6003816004811115611ac457fe5b1415610b4a5760405162461bcd60e51b8152600401808060200182810382526022815260200180611e406022913960400191505060405180910390fd5b611b0c838383610c1d565b611b14610b51565b15610c1d5760405162461bcd60e51b815260040180806020018281038252602a815260200180612029602a913960400191505060405180910390fd5b6000611b5c8383611939565b611b9257508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610812565b506000610812565b60008181526001830160205260408120548015611c565783546000198083019190810190600090879083908110611bcd57fe5b9060005260206000200154905080876000018481548110611bea57fe5b600091825260208083209091019290925582815260018981019092526040902090840190558654879080611c1a57fe5b60019003818190600052602060002001600090559055866001016000878152602001908152602001600020600090556001945050505050610812565b6000915050610812565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115611c975750600090506003611d1f565b60408051600080825260208083018085528a905260ff89168385015260608301889052608083018790529251909260019260a080820193601f1981019281900390910190855afa158015611cef573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611d1857506000915060019050611d1f565b9150600090505b9450949250505056fe456e756d657261626c655365743a20696e646578206f7574206f6620626f756e647345524332303a207472616e7366657220746f20746865207a65726f2061646472657373416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f206772616e7445524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20756e706175736545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565416363657373436f6e74726f6c3a2073656e646572206d75737420626520616e2061646d696e20746f207265766f6b6545524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e636545524332305072657365744d696e7465725061757365723a206d7573742068617665206d696e74657220726f6c6520746f206d696e7445524332303a206275726e20616d6f756e74206578636565647320616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f20616464726573736e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c945524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f206164647265737345524332305072657365744d696e7465725061757365723a206d75737420686176652070617573657220726f6c6520746f20706175736545524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636520726f6c657320666f722073656c6645524332305061757361626c653a20746f6b656e207472616e73666572207768696c6520706175736564a2646970667358221220cb04db20aedb62b2ca6d4945ebbc04fccc4a3160d9e1a981d226ce82a0576e3964736f6c63430006040033") ) diff --git a/meter/params.go b/meter/params.go index 710d5ab4..4688ebb8 100644 --- a/meter/params.go +++ b/meter/params.go @@ -199,4 +199,23 @@ var ( TeslaValidatorBenefitRatio = big.NewInt(1e18) NewViewPeersLimit = 8 + + // in order to provide different addresses during testing and mainnet + // so defined all these vairables here + // will be different values during testing + USDC_eth_Address = MustParseAddress("0xd86e243fc0007e6226b07c9a50c9d70d78299eb5") + USDT_eth_Address = MustParseAddress("0x5fa41671c48e3c951afc30816947126ccc8c162e") + WBTC_eth_Address = MustParseAddress("0xc1f6c86abee8e2e0b6fd5bd80f0b51fef783635c") ) + +func USDCAddress() Address { + return USDC_eth_Address +} + +func USDTAddress() Address { + return USDT_eth_Address +} + +func WBTCAddress() Address { + return WBTC_eth_Address +} diff --git a/runtime/runtime.go b/runtime/runtime.go index 2082f771..d2deb7e4 100644 --- a/runtime/runtime.go +++ b/runtime/runtime.go @@ -489,7 +489,7 @@ func (rt *Runtime) EnforceTeslaFork10_Corrections(stateDB *statedb.StateDB, bloc } } -func (rt *Runtime) EnforceTeslaFork11_Corrections(stateDB *statedb.StateDB, blockNum *big.Int, USDCAddr, USDTAddr, WBTCAddr meter.Address) { +func (rt *Runtime) EnforceTeslaFork11_Corrections(stateDB *statedb.StateDB, blockNum *big.Int, evm *vm.EVM) { blockNumber := rt.Context().Number log := log15.New("pkg", "fork11") if blockNumber > 0 { @@ -499,17 +499,40 @@ func (rt *Runtime) EnforceTeslaFork11_Corrections(stateDB *statedb.StateDB, bloc if meter.IsMainNet() && meter.IsTeslaFork11(blockNumber) && (enforceFlag == nil || enforceFlag.Sign() == 0) { log.Info("Start fork11 correction") + // initializeSelector, _ := hex.DecodeString("8129fc1c") // initialize + // update USDC.eth with ERC20MinterBurnerPauserPermit - rt.state.SetCode(USDCAddr, builtin.ERC20MinterBurnerPauserPermit_DeployedBytecode) - log.Info("Overriden USDC.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", USDCAddr.String()) + USDCAddress := meter.USDCAddress() + rt.state.SetCode(USDCAddress, builtin.USDCEthV2_DeployedBytecode) + log.Info("Overriden USDC.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", USDCAddress) + // ret, leftOverGas, vmErr := evm.Call(vm.AccountRef(meter.ZeroAddress), common.Address(USDCAddress), initializeSelector, 350000, big.NewInt(0), 0) + // if vmErr != nil { + // log.Error("could not call initialize() on USDC.eth", "vmErr", vmErr, "ret", hex.EncodeToString(ret), "leftoverGas", leftOverGas) + // } else { + // log.Info("Called initialize() on USDC.eth") + // } // update USDT.eth with ERC20MinterBurnerPauserPermit - rt.state.SetCode(USDTAddr, builtin.ERC20MinterBurnerPauserPermit_DeployedBytecode) - log.Info("Overriden USDT.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", USDTAddr.String()) + USDTAddress := meter.USDTAddress() + rt.state.SetCode(USDTAddress, builtin.USDTEthV2_DeployedBytecode) + log.Info("Overriden USDT.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", USDTAddress) + // ret, leftOverGas, vmErr = evm.Call(vm.AccountRef(meter.ZeroAddress), common.Address(USDTAddress), initializeSelector, 350000, big.NewInt(0), 0) + // if vmErr != nil { + // log.Error("could not call initialize() on USDT.eth", "vmErr", vmErr, "ret", hex.EncodeToString(ret), "leftoverGas", leftOverGas) + // } else { + // log.Info("Called initialize() on USDT.eth") + // } // update WBTC.eth with ERC20MinterBurnerPauserPermit - rt.state.SetCode(WBTCAddr, builtin.ERC20MinterBurnerPauserPermit_DeployedBytecode) - log.Info("Overriden WBTC.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", WBTCAddr.String()) + WBTCAddress := meter.WBTCAddress() + rt.state.SetCode(WBTCAddress, builtin.WBTCEthV2_DeployedBytecode) + log.Info("Overriden WBTC.eth with ERC20MinterBurnerPauserPermit bytecode", "addr", WBTCAddress) + // ret, leftOverGas, vmErr = evm.Call(vm.AccountRef(meter.ZeroAddress), common.Address(WBTCAddress), initializeSelector, 350000, big.NewInt(0), 0) + // if vmErr != nil { + // log.Error("could not call initialize() on WBTC.eth", "vmErr", vmErr, "ret", hex.EncodeToString(ret), "leftoverGas", leftOverGas) + // } else { + // log.Info("Called initialize() on WBTC.eth") + // } // update baseSequenceAfterFork11 auctionCB := rt.state.GetAuctionCB() @@ -919,7 +942,7 @@ func (rt *Runtime) PrepareClause( rt.EnforceTeslaFork10_Corrections(stateDB, evm.BlockNumber) // tesla fork11 - rt.EnforceTeslaFork11_Corrections(stateDB, evm.BlockNumber, meter.MustParseAddress("0xd86e243fc0007e6226b07c9a50c9d70d78299eb5"), meter.MustParseAddress("0x5fa41671c48e3c951afc30816947126ccc8c162e"), meter.MustParseAddress("0xc1f6c86abee8e2e0b6fd5bd80f0b51fef783635c")) + rt.EnforceTeslaFork11_Corrections(stateDB, evm.BlockNumber, evm) // check the restriction of transfer. if rt.restrictTransfer(stateDB, txCtx.Origin, clause.Value(), clause.Token(), rt.ctx.Number) == true { diff --git a/tests/fork11/utils.go b/tests/fork11/utils.go index 061601f0..57b535a9 100644 --- a/tests/fork11/utils.go +++ b/tests/fork11/utils.go @@ -226,7 +226,19 @@ func initRuntimeAfterFork11() *tests.TestEnv { rt.EnforceTeslaFork8_LiquidStaking(sdb, big.NewInt(0)) rt.EnforceTeslaFork10_Corrections(sdb, big.NewInt(0)) - rt.EnforceTeslaFork11_Corrections(sdb, big.NewInt(0), USDCAddr, USDTAddr, WBTCAddr) + meter.USDC_eth_Address = USDCAddr + meter.USDT_eth_Address = USDTAddr + meter.WBTC_eth_Address = WBTCAddr + transferAfterFork := tests.BuildTransferTx(c.Tag(), 1, tests.HolderAddr, big.NewInt(1), tests.VoterKey) + receipt, err := rt.ExecuteTransaction(transferAfterFork) + if err != nil { + panic(err) + } + if receipt.Reverted { + panic("could not execute after fork11") + } + + // rt.EnforceTeslaFork11_Corrections(sdb, big.NewInt(0), evm, USDCAddr, USDTAddr, WBTCAddr) return &tests.TestEnv{Runtime: rt, State: st, BktCreateTS: 0, CurrentTS: currentTs, ChainTag: c.Tag()} } diff --git a/tests/tx_helpers.go b/tests/tx_helpers.go index 07181305..1eb81da4 100644 --- a/tests/tx_helpers.go +++ b/tests/tx_helpers.go @@ -85,6 +85,25 @@ func BuildVoteTx(chainTag byte, voterKey *ecdsa.PrivateKey, voterAddr meter.Addr return BuildStakingTx(chainTag, 0, body, voterKey, 0) } +func BuildTransferTx(chainTag byte, bestRef uint32, to meter.Address, amount *big.Int, signerKey *ecdsa.PrivateKey) *tx.Transaction { + builder := new(tx.Builder) + builder.ChainTag(chainTag). + BlockRef(tx.NewBlockRef(bestRef)). + Expiration(720). + GasPriceCoef(0). + Gas(meter.BaseTxGas * 2). + DependsOn(nil). + Nonce(uint64(rand.Intn(9999))) + + builder.Clause( + tx.NewClause(&to).WithValue(amount).WithToken(meter.MTRG).WithData(make([]byte, 0)), + ) + trx := builder.Build() + sig, _ := crypto.Sign(trx.SigningHash().Bytes(), signerKey) + trx = trx.WithSignature(sig) + return trx +} + func BuildContractCallTx(chainTag byte, bestRef uint32, to meter.Address, data []byte, signerKey *ecdsa.PrivateKey) *tx.Transaction { builder := new(tx.Builder) builder.ChainTag(chainTag).