From b96bb36985fa3ca4b06b1551608d5cf5bf79e4a0 Mon Sep 17 00:00:00 2001 From: dreamer Date: Tue, 16 Apr 2024 16:23:17 +0800 Subject: [PATCH] update erc20 contract --- contracts/Token.sol | 35 ++++++++++++++++++++----- contracts/compiled_contracts/Token.json | 31 +++++++++++++++++++++- modules/token/keeper/evm_hook.go | 9 ++++--- 3 files changed, 64 insertions(+), 11 deletions(-) diff --git a/contracts/Token.sol b/contracts/Token.sol index 4b451ba6..0d2b4f87 100644 --- a/contracts/Token.sol +++ b/contracts/Token.sol @@ -7,7 +7,7 @@ import "@openzeppelin/contracts/access/Ownable.sol"; import "@openzeppelin/contracts/utils/ReentrancyGuard.sol"; contract Token is ERC20, ERC20Permit, Ownable, ReentrancyGuard { - event SwapToNative(string to, uint256 amount); + event SwapToNative(address from, string to, uint256 amount); uint8 private _scale; @@ -67,12 +67,35 @@ contract Token is ERC20, ERC20Permit, Ownable, ReentrancyGuard { * - `to` cannot be the zero address. * - `amount` caller must have a balance of at least `amount`. */ - function swapToNative( + function swapToNative(string memory to, uint256 amount) + public + nonReentrant + { + require(bytes(to).length > 0, "to must be vaild iaa address"); + + _burn(msg.sender, amount); + emit SwapToNative(msg.sender, to, amount); + } + + /** + * + * Requirements: + * + * - `from` authorizer address. + * - `to` cannot be the zero address. + * - `amount` from must have a balance of at least `amount`. + */ + function swapToNativeFrom( + address from, string memory to, uint256 amount ) public nonReentrant { - require(bytes(to).length > 0, "to must be a vaild iaa address"); - _burn(msg.sender, amount); - emit SwapToNative(to, amount); + require(bytes(to).length > 0, "to must be vaild iaa address"); + + address spender = _msgSender(); + _spendAllowance(from, spender, amount); + + _burn(from, amount); + emit SwapToNative(from, to, amount); } -} \ No newline at end of file +} diff --git a/contracts/compiled_contracts/Token.json b/contracts/compiled_contracts/Token.json index ea02e486..9a6faebf 100644 --- a/contracts/compiled_contracts/Token.json +++ b/contracts/compiled_contracts/Token.json @@ -273,6 +273,12 @@ { "anonymous": false, "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "from", + "type": "address" + }, { "indexed": false, "internalType": "string", @@ -599,6 +605,29 @@ "stateMutability": "nonpayable", "type": "function" }, + { + "inputs": [ + { + "internalType": "address", + "name": "from", + "type": "address" + }, + { + "internalType": "string", + "name": "to", + "type": "string" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "swapToNativeFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "symbol", @@ -692,5 +721,5 @@ "type": "function" } ], - "bin": "6101606040523480156200001257600080fd5b5060405162002f3238038062002f328339818101604052810190620000389190620005c0565b3383806040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525086868160039081620000849190620008a5565b508060049081620000969190620008a5565b505050620000af600583620001fd60201b90919060201c565b6101208181525050620000cd600682620001fd60201b90919060201c565b6101408181525050818051906020012060e08181525050808051906020012061010081815250504660a081815250506200010c6200025560201b60201c565b608081815250503073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff1681525050505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620001bf5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620001b69190620009d1565b60405180910390fd5b620001d081620002b260201b60201c565b50600160098190555080600a60006101000a81548160ff021916908360ff16021790555050505062000b8f565b600060208351101562000223576200021b836200037860201b60201c565b90506200024f565b826200023583620003e560201b60201c565b6000019081620002469190620008a5565b5060ff60001b90505b92915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60e0516101005146306040516020016200029795949392919062000a1a565b60405160208183030381529060405280519060200120905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080829050601f81511115620003c857826040517f305a27a9000000000000000000000000000000000000000000000000000000008152600401620003bf919062000ac9565b60405180910390fd5b805181620003d69062000b1f565b60001c1760001b915050919050565b6000819050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000458826200040d565b810181811067ffffffffffffffff821117156200047a57620004796200041e565b5b80604052505050565b60006200048f620003ef565b90506200049d82826200044d565b919050565b600067ffffffffffffffff821115620004c057620004bf6200041e565b5b620004cb826200040d565b9050602081019050919050565b60005b83811015620004f8578082015181840152602081019050620004db565b60008484015250505050565b60006200051b6200051584620004a2565b62000483565b9050828152602081018484840111156200053a576200053962000408565b5b62000547848285620004d8565b509392505050565b600082601f83011262000567576200056662000403565b5b81516200057984826020860162000504565b91505092915050565b600060ff82169050919050565b6200059a8162000582565b8114620005a657600080fd5b50565b600081519050620005ba816200058f565b92915050565b600080600060608486031215620005dc57620005db620003f9565b5b600084015167ffffffffffffffff811115620005fd57620005fc620003fe565b5b6200060b868287016200054f565b935050602084015167ffffffffffffffff8111156200062f576200062e620003fe565b5b6200063d868287016200054f565b92505060406200065086828701620005a9565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006ad57607f821691505b602082108103620006c357620006c262000665565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200072d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620006ee565b620007398683620006ee565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000786620007806200077a8462000751565b6200075b565b62000751565b9050919050565b6000819050919050565b620007a28362000765565b620007ba620007b1826200078d565b848454620006fb565b825550505050565b600090565b620007d1620007c2565b620007de81848462000797565b505050565b5b818110156200080657620007fa600082620007c7565b600181019050620007e4565b5050565b601f82111562000855576200081f81620006c9565b6200082a84620006de565b810160208510156200083a578190505b620008526200084985620006de565b830182620007e3565b50505b505050565b600082821c905092915050565b60006200087a600019846008026200085a565b1980831691505092915050565b600062000895838362000867565b9150826002028217905092915050565b620008b0826200065a565b67ffffffffffffffff811115620008cc57620008cb6200041e565b5b620008d8825462000694565b620008e58282856200080a565b600060209050601f8311600181146200091d576000841562000908578287015190505b62000914858262000887565b86555062000984565b601f1984166200092d86620006c9565b60005b82811015620009575784890151825560018201915060208501945060208101905062000930565b8683101562000977578489015162000973601f89168262000867565b8355505b6001600288020188555050505b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620009b9826200098c565b9050919050565b620009cb81620009ac565b82525050565b6000602082019050620009e86000830184620009c0565b92915050565b6000819050919050565b62000a0381620009ee565b82525050565b62000a148162000751565b82525050565b600060a08201905062000a316000830188620009f8565b62000a406020830187620009f8565b62000a4f6040830186620009f8565b62000a5e606083018562000a09565b62000a6d6080830184620009c0565b9695505050505050565b600082825260208201905092915050565b600062000a95826200065a565b62000aa1818562000a77565b935062000ab3818560208601620004d8565b62000abe816200040d565b840191505092915050565b6000602082019050818103600083015262000ae5818462000a88565b905092915050565b600081519050919050565b6000819050602082019050919050565b600062000b168251620009ee565b80915050919050565b600062000b2c8262000aed565b8262000b388462000af8565b905062000b458162000b08565b9250602082101562000b885762000b837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802620006ee565b831692505b5050919050565b60805160a05160c05160e05161010051610120516101405161234862000bea6000396000610f6201526000610f27015260006114770152600061145601526000610b8101526000610bd701526000610c0001526123486000f3fe608060405234801561001057600080fd5b50600436106101215760003560e01c8063715018a6116100ad5780639dc29fac116100715780639dc29fac14610300578063a9059cbb1461031c578063d505accf1461034c578063dd62ed3e14610368578063f2fde38b1461039857610121565b8063715018a6146102665780637ecebe001461027057806384b0196e146102a05780638da5cb5b146102c457806395d89b41146102e257610121565b8063313ce567116100f4578063313ce567146101c25780633644e515146101e057806340c10f19146101fe57806354162c9c1461021a57806370a082311461023657610121565b806306fdde0314610126578063095ea7b31461014457806318160ddd1461017457806323b872dd14610192575b600080fd5b61012e6103b4565b60405161013b9190611964565b60405180910390f35b61015e60048036038101906101599190611a2e565b610446565b60405161016b9190611a89565b60405180910390f35b61017c610469565b6040516101899190611ab3565b60405180910390f35b6101ac60048036038101906101a79190611ace565b610473565b6040516101b99190611a89565b60405180910390f35b6101ca6104a2565b6040516101d79190611b3d565b60405180910390f35b6101e86104b9565b6040516101f59190611b71565b60405180910390f35b61021860048036038101906102139190611a2e565b6104c8565b005b610234600480360381019061022f9190611cc1565b6104de565b005b610250600480360381019061024b9190611d1d565b610579565b60405161025d9190611ab3565b60405180910390f35b61026e6105c1565b005b61028a60048036038101906102859190611d1d565b6105d5565b6040516102979190611ab3565b60405180910390f35b6102a86105e7565b6040516102bb9796959493929190611e52565b60405180910390f35b6102cc610691565b6040516102d99190611ed6565b60405180910390f35b6102ea6106bb565b6040516102f79190611964565b60405180910390f35b61031a60048036038101906103159190611a2e565b61074d565b005b61033660048036038101906103319190611a2e565b610763565b6040516103439190611a89565b60405180910390f35b61036660048036038101906103619190611f49565b610786565b005b610382600480360381019061037d9190611feb565b6108ce565b60405161038f9190611ab3565b60405180910390f35b6103b260048036038101906103ad9190611d1d565b610955565b005b6060600380546103c39061205a565b80601f01602080910402602001604051908101604052809291908181526020018280546103ef9061205a565b801561043c5780601f106104115761010080835404028352916020019161043c565b820191906000526020600020905b81548152906001019060200180831161041f57829003601f168201915b5050505050905090565b6000806104516109db565b905061045e8185856109e3565b600191505092915050565b6000600254905090565b60008061047e6109db565b905061048b8582856109f5565b610496858585610a89565b60019150509392505050565b6000600a60009054906101000a900460ff16905090565b60006104c3610b7d565b905090565b6104d0610c34565b6104da8282610cbb565b5050565b6104e6610d3d565b600082511161052a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610521906120d7565b60405180910390fd5b6105343382610d83565b7fdc8816a42330f36689bab19260b5da3dda186ae243971d08f90739246368ea6782826040516105659291906120f7565b60405180910390a1610575610e05565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105c9610c34565b6105d36000610e0f565b565b60006105e082610ed5565b9050919050565b6000606080600080600060606105fb610f1e565b610603610f59565b46306000801b600067ffffffffffffffff81111561062457610623611b96565b5b6040519080825280602002602001820160405280156106525781602001602082028036833780820191505090505b507f0f00000000000000000000000000000000000000000000000000000000000000959493929190965096509650965096509650965090919293949596565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546106ca9061205a565b80601f01602080910402602001604051908101604052809291908181526020018280546106f69061205a565b80156107435780601f1061071857610100808354040283529160200191610743565b820191906000526020600020905b81548152906001019060200180831161072657829003601f168201915b5050505050905090565b610755610c34565b61075f8282610d83565b5050565b60008061076e6109db565b905061077b818585610a89565b600191505092915050565b834211156107cb57836040517f627913020000000000000000000000000000000000000000000000000000000081526004016107c29190611ab3565b60405180910390fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886107fa8c610f94565b8960405160200161081096959493929190612127565b604051602081830303815290604052805190602001209050600061083382610feb565b9050600061084382878787611005565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108b757808a6040517f4b800e460000000000000000000000000000000000000000000000000000000081526004016108ae929190612188565b60405180910390fd5b6108c28a8a8a6109e3565b50505050505050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61095d610c34565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036109cf5760006040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016109c69190611ed6565b60405180910390fd5b6109d881610e0f565b50565b600033905090565b6109f08383836001611035565b505050565b6000610a0184846108ce565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610a835781811015610a73578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610a6a939291906121b1565b60405180910390fd5b610a8284848484036000611035565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610afb5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610af29190611ed6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b6d5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610b649190611ed6565b60405180910390fd5b610b7883838361120c565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148015610bf957507f000000000000000000000000000000000000000000000000000000000000000046145b15610c26577f00000000000000000000000000000000000000000000000000000000000000009050610c31565b610c2e611431565b90505b90565b610c3c6109db565b73ffffffffffffffffffffffffffffffffffffffff16610c5a610691565b73ffffffffffffffffffffffffffffffffffffffff1614610cb957610c7d6109db565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610cb09190611ed6565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610d2d5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610d249190611ed6565b60405180910390fd5b610d396000838361120c565b5050565b600260095403610d79576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600981905550565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610df55760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610dec9190611ed6565b60405180910390fd5b610e018260008361120c565b5050565b6001600981905550565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060610f5460057f00000000000000000000000000000000000000000000000000000000000000006114c790919063ffffffff16565b905090565b6060610f8f60067f00000000000000000000000000000000000000000000000000000000000000006114c790919063ffffffff16565b905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050559050919050565b6000610ffe610ff8610b7d565b83611577565b9050919050565b600080600080611017888888886115b8565b92509250925061102782826116ac565b829350505050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036110a75760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161109e9190611ed6565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111195760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016111109190611ed6565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611206578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516111fd9190611ab3565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361125e5780600260008282546112529190612217565b92505081905550611331565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156112ea578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016112e1939291906121b1565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361137a57806002600082825403925050819055506113c7565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516114249190611ab3565b60405180910390a3505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f00000000000000000000000000000000000000000000000000000000000000007f000000000000000000000000000000000000000000000000000000000000000046306040516020016114ac95949392919061224b565b60405160208183030381529060405280519060200120905090565b606060ff60001b83146114e4576114dd83611810565b9050611571565b8180546114f09061205a565b80601f016020809104026020016040519081016040528092919081815260200182805461151c9061205a565b80156115695780601f1061153e57610100808354040283529160200191611569565b820191906000526020600020905b81548152906001019060200180831161154c57829003601f168201915b505050505090505b92915050565b60006040517f190100000000000000000000000000000000000000000000000000000000000081528360028201528260228201526042812091505092915050565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c11156115f85760006003859250925092506116a2565b60006001888888886040516000815260200160405260405161161d949392919061229e565b6020604051602081039080840390855afa15801561163f573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361169357600060016000801b935093509350506116a2565b8060008060001b935093509350505b9450945094915050565b600060038111156116c0576116bf6122e3565b5b8260038111156116d3576116d26122e3565b5b031561180c57600160038111156116ed576116ec6122e3565b5b826003811115611700576116ff6122e3565b5b03611737576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600381111561174b5761174a6122e3565b5b82600381111561175e5761175d6122e3565b5b036117a3578060001c6040517ffce698f700000000000000000000000000000000000000000000000000000000815260040161179a9190611ab3565b60405180910390fd5b6003808111156117b6576117b56122e3565b5b8260038111156117c9576117c86122e3565b5b0361180b57806040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004016118029190611b71565b60405180910390fd5b5b5050565b6060600061181d83611884565b90506000602067ffffffffffffffff81111561183c5761183b611b96565b5b6040519080825280601f01601f19166020018201604052801561186e5781602001600182028036833780820191505090505b5090508181528360208201528092505050919050565b60008060ff8360001c169050601f8111156118cb576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561190e5780820151818401526020810190506118f3565b60008484015250505050565b6000601f19601f8301169050919050565b6000611936826118d4565b61194081856118df565b93506119508185602086016118f0565b6119598161191a565b840191505092915050565b6000602082019050818103600083015261197e818461192b565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006119c58261199a565b9050919050565b6119d5816119ba565b81146119e057600080fd5b50565b6000813590506119f2816119cc565b92915050565b6000819050919050565b611a0b816119f8565b8114611a1657600080fd5b50565b600081359050611a2881611a02565b92915050565b60008060408385031215611a4557611a44611990565b5b6000611a53858286016119e3565b9250506020611a6485828601611a19565b9150509250929050565b60008115159050919050565b611a8381611a6e565b82525050565b6000602082019050611a9e6000830184611a7a565b92915050565b611aad816119f8565b82525050565b6000602082019050611ac86000830184611aa4565b92915050565b600080600060608486031215611ae757611ae6611990565b5b6000611af5868287016119e3565b9350506020611b06868287016119e3565b9250506040611b1786828701611a19565b9150509250925092565b600060ff82169050919050565b611b3781611b21565b82525050565b6000602082019050611b526000830184611b2e565b92915050565b6000819050919050565b611b6b81611b58565b82525050565b6000602082019050611b866000830184611b62565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611bce8261191a565b810181811067ffffffffffffffff82111715611bed57611bec611b96565b5b80604052505050565b6000611c00611986565b9050611c0c8282611bc5565b919050565b600067ffffffffffffffff821115611c2c57611c2b611b96565b5b611c358261191a565b9050602081019050919050565b82818337600083830152505050565b6000611c64611c5f84611c11565b611bf6565b905082815260208101848484011115611c8057611c7f611b91565b5b611c8b848285611c42565b509392505050565b600082601f830112611ca857611ca7611b8c565b5b8135611cb8848260208601611c51565b91505092915050565b60008060408385031215611cd857611cd7611990565b5b600083013567ffffffffffffffff811115611cf657611cf5611995565b5b611d0285828601611c93565b9250506020611d1385828601611a19565b9150509250929050565b600060208284031215611d3357611d32611990565b5b6000611d41848285016119e3565b91505092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b611d7f81611d4a565b82525050565b611d8e816119ba565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611dc9816119f8565b82525050565b6000611ddb8383611dc0565b60208301905092915050565b6000602082019050919050565b6000611dff82611d94565b611e098185611d9f565b9350611e1483611db0565b8060005b83811015611e45578151611e2c8882611dcf565b9750611e3783611de7565b925050600181019050611e18565b5085935050505092915050565b600060e082019050611e67600083018a611d76565b8181036020830152611e79818961192b565b90508181036040830152611e8d818861192b565b9050611e9c6060830187611aa4565b611ea96080830186611d85565b611eb660a0830185611b62565b81810360c0830152611ec88184611df4565b905098975050505050505050565b6000602082019050611eeb6000830184611d85565b92915050565b611efa81611b21565b8114611f0557600080fd5b50565b600081359050611f1781611ef1565b92915050565b611f2681611b58565b8114611f3157600080fd5b50565b600081359050611f4381611f1d565b92915050565b600080600080600080600060e0888a031215611f6857611f67611990565b5b6000611f768a828b016119e3565b9750506020611f878a828b016119e3565b9650506040611f988a828b01611a19565b9550506060611fa98a828b01611a19565b9450506080611fba8a828b01611f08565b93505060a0611fcb8a828b01611f34565b92505060c0611fdc8a828b01611f34565b91505092959891949750929550565b6000806040838503121561200257612001611990565b5b6000612010858286016119e3565b9250506020612021858286016119e3565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061207257607f821691505b6020821081036120855761208461202b565b5b50919050565b7f746f206d757374206265207661696c6420696161206164647265737300000000600082015250565b60006120c1601c836118df565b91506120cc8261208b565b602082019050919050565b600060208201905081810360008301526120f0816120b4565b9050919050565b60006040820190508181036000830152612111818561192b565b90506121206020830184611aa4565b9392505050565b600060c08201905061213c6000830189611b62565b6121496020830188611d85565b6121566040830187611d85565b6121636060830186611aa4565b6121706080830185611aa4565b61217d60a0830184611aa4565b979650505050505050565b600060408201905061219d6000830185611d85565b6121aa6020830184611d85565b9392505050565b60006060820190506121c66000830186611d85565b6121d36020830185611aa4565b6121e06040830184611aa4565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000612222826119f8565b915061222d836119f8565b9250828201905080821115612245576122446121e8565b5b92915050565b600060a0820190506122606000830188611b62565b61226d6020830187611b62565b61227a6040830186611b62565b6122876060830185611aa4565b6122946080830184611d85565b9695505050505050565b60006080820190506122b36000830187611b62565b6122c06020830186611b2e565b6122cd6040830185611b62565b6122da6060830184611b62565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea264697066735822122022afbe51f591a4cccbb58dddb6c34f0d06152f4414a4b9a91eb36dc9bd79eafe64736f6c63430008170033" + "bin": "6101606040523480156200001257600080fd5b506040516200308e3803806200308e8339818101604052810190620000389190620005c0565b3383806040518060400160405280600181526020017f310000000000000000000000000000000000000000000000000000000000000081525086868160039081620000849190620008a5565b508060049081620000969190620008a5565b505050620000af600583620001fd60201b90919060201c565b6101208181525050620000cd600682620001fd60201b90919060201c565b6101408181525050818051906020012060e08181525050808051906020012061010081815250504660a081815250506200010c6200025560201b60201c565b608081815250503073ffffffffffffffffffffffffffffffffffffffff1660c08173ffffffffffffffffffffffffffffffffffffffff1681525050505050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603620001bf5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401620001b69190620009d1565b60405180910390fd5b620001d081620002b260201b60201c565b50600160098190555080600a60006101000a81548160ff021916908360ff16021790555050505062000b8f565b600060208351101562000223576200021b836200037860201b60201c565b90506200024f565b826200023583620003e560201b60201c565b6000019081620002469190620008a5565b5060ff60001b90505b92915050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60e0516101005146306040516020016200029795949392919062000a1a565b60405160208183030381529060405280519060200120905090565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080829050601f81511115620003c857826040517f305a27a9000000000000000000000000000000000000000000000000000000008152600401620003bf919062000ac9565b60405180910390fd5b805181620003d69062000b1f565b60001c1760001b915050919050565b6000819050919050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b62000458826200040d565b810181811067ffffffffffffffff821117156200047a57620004796200041e565b5b80604052505050565b60006200048f620003ef565b90506200049d82826200044d565b919050565b600067ffffffffffffffff821115620004c057620004bf6200041e565b5b620004cb826200040d565b9050602081019050919050565b60005b83811015620004f8578082015181840152602081019050620004db565b60008484015250505050565b60006200051b6200051584620004a2565b62000483565b9050828152602081018484840111156200053a576200053962000408565b5b62000547848285620004d8565b509392505050565b600082601f83011262000567576200056662000403565b5b81516200057984826020860162000504565b91505092915050565b600060ff82169050919050565b6200059a8162000582565b8114620005a657600080fd5b50565b600081519050620005ba816200058f565b92915050565b600080600060608486031215620005dc57620005db620003f9565b5b600084015167ffffffffffffffff811115620005fd57620005fc620003fe565b5b6200060b868287016200054f565b935050602084015167ffffffffffffffff8111156200062f576200062e620003fe565b5b6200063d868287016200054f565b92505060406200065086828701620005a9565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620006ad57607f821691505b602082108103620006c357620006c262000665565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200072d7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620006ee565b620007398683620006ee565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b600062000786620007806200077a8462000751565b6200075b565b62000751565b9050919050565b6000819050919050565b620007a28362000765565b620007ba620007b1826200078d565b848454620006fb565b825550505050565b600090565b620007d1620007c2565b620007de81848462000797565b505050565b5b818110156200080657620007fa600082620007c7565b600181019050620007e4565b5050565b601f82111562000855576200081f81620006c9565b6200082a84620006de565b810160208510156200083a578190505b620008526200084985620006de565b830182620007e3565b50505b505050565b600082821c905092915050565b60006200087a600019846008026200085a565b1980831691505092915050565b600062000895838362000867565b9150826002028217905092915050565b620008b0826200065a565b67ffffffffffffffff811115620008cc57620008cb6200041e565b5b620008d8825462000694565b620008e58282856200080a565b600060209050601f8311600181146200091d576000841562000908578287015190505b62000914858262000887565b86555062000984565b601f1984166200092d86620006c9565b60005b82811015620009575784890151825560018201915060208501945060208101905062000930565b8683101562000977578489015162000973601f89168262000867565b8355505b6001600288020188555050505b505050505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620009b9826200098c565b9050919050565b620009cb81620009ac565b82525050565b6000602082019050620009e86000830184620009c0565b92915050565b6000819050919050565b62000a0381620009ee565b82525050565b62000a148162000751565b82525050565b600060a08201905062000a316000830188620009f8565b62000a406020830187620009f8565b62000a4f6040830186620009f8565b62000a5e606083018562000a09565b62000a6d6080830184620009c0565b9695505050505050565b600082825260208201905092915050565b600062000a95826200065a565b62000aa1818562000a77565b935062000ab3818560208601620004d8565b62000abe816200040d565b840191505092915050565b6000602082019050818103600083015262000ae5818462000a88565b905092915050565b600081519050919050565b6000819050602082019050919050565b600062000b168251620009ee565b80915050919050565b600062000b2c8262000aed565b8262000b388462000af8565b905062000b458162000b08565b9250602082101562000b885762000b837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff83602003600802620006ee565b831692505b5050919050565b60805160a05160c05160e0516101005161012051610140516124a462000bea600039600061104101526000611006015260006115560152600061153501526000610c6001526000610cb601526000610cdf01526124a46000f3fe608060405234801561001057600080fd5b506004361061012c5760003560e01c80637ecebe00116100ad578063a9059cbb11610071578063a9059cbb14610327578063d505accf14610357578063dd62ed3e14610373578063e9e4e866146103a3578063f2fde38b146103bf5761012c565b80637ecebe001461027b57806384b0196e146102ab5780638da5cb5b146102cf57806395d89b41146102ed5780639dc29fac1461030b5761012c565b80633644e515116100f45780633644e515146101eb57806340c10f191461020957806354162c9c1461022557806370a0823114610241578063715018a6146102715761012c565b806306fdde0314610131578063095ea7b31461014f57806318160ddd1461017f57806323b872dd1461019d578063313ce567146101cd575b600080fd5b6101396103db565b6040516101469190611a43565b60405180910390f35b61016960048036038101906101649190611b0d565b61046d565b6040516101769190611b68565b60405180910390f35b610187610490565b6040516101949190611b92565b60405180910390f35b6101b760048036038101906101b29190611bad565b61049a565b6040516101c49190611b68565b60405180910390f35b6101d56104c9565b6040516101e29190611c1c565b60405180910390f35b6101f36104e0565b6040516102009190611c50565b60405180910390f35b610223600480360381019061021e9190611b0d565b6104ef565b005b61023f600480360381019061023a9190611da0565b610505565b005b61025b60048036038101906102569190611dfc565b6105a2565b6040516102689190611b92565b60405180910390f35b6102796105ea565b005b61029560048036038101906102909190611dfc565b6105fe565b6040516102a29190611b92565b60405180910390f35b6102b3610610565b6040516102c69796959493929190611f31565b60405180910390f35b6102d76106ba565b6040516102e49190611fb5565b60405180910390f35b6102f56106e4565b6040516103029190611a43565b60405180910390f35b61032560048036038101906103209190611b0d565b610776565b005b610341600480360381019061033c9190611b0d565b61078c565b60405161034e9190611b68565b60405180910390f35b610371600480360381019061036c9190612028565b6107af565b005b61038d600480360381019061038891906120ca565b6108f7565b60405161039a9190611b92565b60405180910390f35b6103bd60048036038101906103b8919061210a565b61097e565b005b6103d960048036038101906103d49190611dfc565b610a34565b005b6060600380546103ea906121a8565b80601f0160208091040260200160405190810160405280929190818152602001828054610416906121a8565b80156104635780601f1061043857610100808354040283529160200191610463565b820191906000526020600020905b81548152906001019060200180831161044657829003601f168201915b5050505050905090565b600080610478610aba565b9050610485818585610ac2565b600191505092915050565b6000600254905090565b6000806104a5610aba565b90506104b2858285610ad4565b6104bd858585610b68565b60019150509392505050565b6000600a60009054906101000a900460ff16905090565b60006104ea610c5c565b905090565b6104f7610d13565b6105018282610d9a565b5050565b61050d610e1c565b6000825111610551576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054890612225565b60405180910390fd5b61055b3382610e62565b7faccd23c8bfefb9bb75038060da86669b045e6212cc3d5a08f4d571af8cd4fce533838360405161058e93929190612245565b60405180910390a161059e610ee4565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6105f2610d13565b6105fc6000610eee565b565b600061060982610fb4565b9050919050565b600060608060008060006060610624610ffd565b61062c611038565b46306000801b600067ffffffffffffffff81111561064d5761064c611c75565b5b60405190808252806020026020018201604052801561067b5781602001602082028036833780820191505090505b507f0f00000000000000000000000000000000000000000000000000000000000000959493929190965096509650965096509650965090919293949596565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6060600480546106f3906121a8565b80601f016020809104026020016040519081016040528092919081815260200182805461071f906121a8565b801561076c5780601f106107415761010080835404028352916020019161076c565b820191906000526020600020905b81548152906001019060200180831161074f57829003601f168201915b5050505050905090565b61077e610d13565b6107888282610e62565b5050565b600080610797610aba565b90506107a4818585610b68565b600191505092915050565b834211156107f457836040517f627913020000000000000000000000000000000000000000000000000000000081526004016107eb9190611b92565b60405180910390fd5b60007f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c98888886108238c611073565b8960405160200161083996959493929190612283565b604051602081830303815290604052805190602001209050600061085c826110ca565b9050600061086c828787876110e4565b90508973ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146108e057808a6040517f4b800e460000000000000000000000000000000000000000000000000000000081526004016108d79291906122e4565b60405180910390fd5b6108eb8a8a8a610ac2565b50505050505050505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610986610e1c565b60008251116109ca576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c190612225565b60405180910390fd5b60006109d4610aba565b90506109e1848284610ad4565b6109eb8483610e62565b7faccd23c8bfefb9bb75038060da86669b045e6212cc3d5a08f4d571af8cd4fce5848484604051610a1e93929190612245565b60405180910390a150610a2f610ee4565b505050565b610a3c610d13565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610aae5760006040517f1e4fbdf7000000000000000000000000000000000000000000000000000000008152600401610aa59190611fb5565b60405180910390fd5b610ab781610eee565b50565b600033905090565b610acf8383836001611114565b505050565b6000610ae084846108f7565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610b625781811015610b52578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401610b499392919061230d565b60405180910390fd5b610b6184848484036000611114565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610bda5760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610bd19190611fb5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c4c5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610c439190611fb5565b60405180910390fd5b610c578383836112eb565b505050565b60007f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff163073ffffffffffffffffffffffffffffffffffffffff16148015610cd857507f000000000000000000000000000000000000000000000000000000000000000046145b15610d05577f00000000000000000000000000000000000000000000000000000000000000009050610d10565b610d0d611510565b90505b90565b610d1b610aba565b73ffffffffffffffffffffffffffffffffffffffff16610d396106ba565b73ffffffffffffffffffffffffffffffffffffffff1614610d9857610d5c610aba565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401610d8f9190611fb5565b60405180910390fd5b565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610e0c5760006040517fec442f05000000000000000000000000000000000000000000000000000000008152600401610e039190611fb5565b60405180910390fd5b610e18600083836112eb565b5050565b600260095403610e58576040517f3ee5aeb500000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600981905550565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ed45760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401610ecb9190611fb5565b60405180910390fd5b610ee0826000836112eb565b5050565b6001600981905550565b6000600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b606061103360057f00000000000000000000000000000000000000000000000000000000000000006115a690919063ffffffff16565b905090565b606061106e60067f00000000000000000000000000000000000000000000000000000000000000006115a690919063ffffffff16565b905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000815480929190600101919050559050919050565b60006110dd6110d7610c5c565b83611656565b9050919050565b6000806000806110f688888888611697565b925092509250611106828261178b565b829350505050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036111865760006040517fe602df0500000000000000000000000000000000000000000000000000000000815260040161117d9190611fb5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036111f85760006040517f94280d620000000000000000000000000000000000000000000000000000000081526004016111ef9190611fb5565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555080156112e5578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516112dc9190611b92565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361133d5780600260008282546113319190612373565b92505081905550611410565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156113c9578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016113c09392919061230d565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361145957806002600082825403925050819055506114a6565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516115039190611b92565b60405180910390a3505050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f7f00000000000000000000000000000000000000000000000000000000000000007f0000000000000000000000000000000000000000000000000000000000000000463060405160200161158b9594939291906123a7565b60405160208183030381529060405280519060200120905090565b606060ff60001b83146115c3576115bc836118ef565b9050611650565b8180546115cf906121a8565b80601f01602080910402602001604051908101604052809291908181526020018280546115fb906121a8565b80156116485780601f1061161d57610100808354040283529160200191611648565b820191906000526020600020905b81548152906001019060200180831161162b57829003601f168201915b505050505090505b92915050565b60006040517f190100000000000000000000000000000000000000000000000000000000000081528360028201528260228201526042812091505092915050565b60008060007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08460001c11156116d7576000600385925092509250611781565b6000600188888888604051600081526020016040526040516116fc94939291906123fa565b6020604051602081039080840390855afa15801561171e573d6000803e3d6000fd5b505050602060405103519050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff160361177257600060016000801b93509350935050611781565b8060008060001b935093509350505b9450945094915050565b6000600381111561179f5761179e61243f565b5b8260038111156117b2576117b161243f565b5b03156118eb57600160038111156117cc576117cb61243f565b5b8260038111156117df576117de61243f565b5b03611816576040517ff645eedf00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6002600381111561182a5761182961243f565b5b82600381111561183d5761183c61243f565b5b03611882578060001c6040517ffce698f70000000000000000000000000000000000000000000000000000000081526004016118799190611b92565b60405180910390fd5b6003808111156118955761189461243f565b5b8260038111156118a8576118a761243f565b5b036118ea57806040517fd78bce0c0000000000000000000000000000000000000000000000000000000081526004016118e19190611c50565b60405180910390fd5b5b5050565b606060006118fc83611963565b90506000602067ffffffffffffffff81111561191b5761191a611c75565b5b6040519080825280601f01601f19166020018201604052801561194d5781602001600182028036833780820191505090505b5090508181528360208201528092505050919050565b60008060ff8360001c169050601f8111156119aa576040517fb3512b0c00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80915050919050565b600081519050919050565b600082825260208201905092915050565b60005b838110156119ed5780820151818401526020810190506119d2565b60008484015250505050565b6000601f19601f8301169050919050565b6000611a15826119b3565b611a1f81856119be565b9350611a2f8185602086016119cf565b611a38816119f9565b840191505092915050565b60006020820190508181036000830152611a5d8184611a0a565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611aa482611a79565b9050919050565b611ab481611a99565b8114611abf57600080fd5b50565b600081359050611ad181611aab565b92915050565b6000819050919050565b611aea81611ad7565b8114611af557600080fd5b50565b600081359050611b0781611ae1565b92915050565b60008060408385031215611b2457611b23611a6f565b5b6000611b3285828601611ac2565b9250506020611b4385828601611af8565b9150509250929050565b60008115159050919050565b611b6281611b4d565b82525050565b6000602082019050611b7d6000830184611b59565b92915050565b611b8c81611ad7565b82525050565b6000602082019050611ba76000830184611b83565b92915050565b600080600060608486031215611bc657611bc5611a6f565b5b6000611bd486828701611ac2565b9350506020611be586828701611ac2565b9250506040611bf686828701611af8565b9150509250925092565b600060ff82169050919050565b611c1681611c00565b82525050565b6000602082019050611c316000830184611c0d565b92915050565b6000819050919050565b611c4a81611c37565b82525050565b6000602082019050611c656000830184611c41565b92915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b611cad826119f9565b810181811067ffffffffffffffff82111715611ccc57611ccb611c75565b5b80604052505050565b6000611cdf611a65565b9050611ceb8282611ca4565b919050565b600067ffffffffffffffff821115611d0b57611d0a611c75565b5b611d14826119f9565b9050602081019050919050565b82818337600083830152505050565b6000611d43611d3e84611cf0565b611cd5565b905082815260208101848484011115611d5f57611d5e611c70565b5b611d6a848285611d21565b509392505050565b600082601f830112611d8757611d86611c6b565b5b8135611d97848260208601611d30565b91505092915050565b60008060408385031215611db757611db6611a6f565b5b600083013567ffffffffffffffff811115611dd557611dd4611a74565b5b611de185828601611d72565b9250506020611df285828601611af8565b9150509250929050565b600060208284031215611e1257611e11611a6f565b5b6000611e2084828501611ac2565b91505092915050565b60007fff0000000000000000000000000000000000000000000000000000000000000082169050919050565b611e5e81611e29565b82525050565b611e6d81611a99565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b611ea881611ad7565b82525050565b6000611eba8383611e9f565b60208301905092915050565b6000602082019050919050565b6000611ede82611e73565b611ee88185611e7e565b9350611ef383611e8f565b8060005b83811015611f24578151611f0b8882611eae565b9750611f1683611ec6565b925050600181019050611ef7565b5085935050505092915050565b600060e082019050611f46600083018a611e55565b8181036020830152611f588189611a0a565b90508181036040830152611f6c8188611a0a565b9050611f7b6060830187611b83565b611f886080830186611e64565b611f9560a0830185611c41565b81810360c0830152611fa78184611ed3565b905098975050505050505050565b6000602082019050611fca6000830184611e64565b92915050565b611fd981611c00565b8114611fe457600080fd5b50565b600081359050611ff681611fd0565b92915050565b61200581611c37565b811461201057600080fd5b50565b60008135905061202281611ffc565b92915050565b600080600080600080600060e0888a03121561204757612046611a6f565b5b60006120558a828b01611ac2565b97505060206120668a828b01611ac2565b96505060406120778a828b01611af8565b95505060606120888a828b01611af8565b94505060806120998a828b01611fe7565b93505060a06120aa8a828b01612013565b92505060c06120bb8a828b01612013565b91505092959891949750929550565b600080604083850312156120e1576120e0611a6f565b5b60006120ef85828601611ac2565b925050602061210085828601611ac2565b9150509250929050565b60008060006060848603121561212357612122611a6f565b5b600061213186828701611ac2565b935050602084013567ffffffffffffffff81111561215257612151611a74565b5b61215e86828701611d72565b925050604061216f86828701611af8565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806121c057607f821691505b6020821081036121d3576121d2612179565b5b50919050565b7f746f206d757374206265207661696c6420696161206164647265737300000000600082015250565b600061220f601c836119be565b915061221a826121d9565b602082019050919050565b6000602082019050818103600083015261223e81612202565b9050919050565b600060608201905061225a6000830186611e64565b818103602083015261226c8185611a0a565b905061227b6040830184611b83565b949350505050565b600060c0820190506122986000830189611c41565b6122a56020830188611e64565b6122b26040830187611e64565b6122bf6060830186611b83565b6122cc6080830185611b83565b6122d960a0830184611b83565b979650505050505050565b60006040820190506122f96000830185611e64565b6123066020830184611e64565b9392505050565b60006060820190506123226000830186611e64565b61232f6020830185611b83565b61233c6040830184611b83565b949350505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061237e82611ad7565b915061238983611ad7565b92508282019050808211156123a1576123a0612344565b5b92915050565b600060a0820190506123bc6000830188611c41565b6123c96020830187611c41565b6123d66040830186611c41565b6123e36060830185611b83565b6123f06080830184611e64565b9695505050505050565b600060808201905061240f6000830187611c41565b61241c6020830186611c0d565b6124296040830185611c41565b6124366060830184611c41565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fdfea2646970667358221220100d3318e24cd51ad95864776eec874a4d562178142531a22db6278cbd7dc88a64736f6c63430008170033" } diff --git a/modules/token/keeper/evm_hook.go b/modules/token/keeper/evm_hook.go index 9ca6a63b..772c8eb0 100644 --- a/modules/token/keeper/evm_hook.go +++ b/modules/token/keeper/evm_hook.go @@ -31,6 +31,7 @@ func (hook erc20Hook) PostTxProcessing(ctx sdk.Context, msg core.Message, receip erc20 := contracts.ERC20TokenContract.ABI for _, log := range receipt.Logs { // Note: the `SwapToNative` event contains 1 topics + // SwapToNative(address from, string to, uint256 amount) if len(log.Topics) != 1 { continue } @@ -59,15 +60,15 @@ func (hook erc20Hook) PostTxProcessing(ctx sdk.Context, msg core.Message, receip return errorsmod.Wrap(types.ErrInvalidContract, "failed to unpack SwapToNative event") } - if len(eventArgs) != 2 { + if len(eventArgs) != 3 { return errorsmod.Wrapf( types.ErrInvalidContract, - "swapToNative event has wrong number of parameters, expected 2, actual: %d", + "swapToNative event has wrong number of parameters, expected 3, actual: %d", len(eventArgs), ) } - to, ok := eventArgs[0].(string) + to, ok := eventArgs[1].(string) if !ok || len(to) == 0 { return errorsmod.Wrap( types.ErrInvalidContract, @@ -84,7 +85,7 @@ func (hook erc20Hook) PostTxProcessing(ctx sdk.Context, msg core.Message, receip ) } - amount, ok := eventArgs[1].(*big.Int) + amount, ok := eventArgs[2].(*big.Int) if !ok || amount.Cmp(big.NewInt(0)) == 0 { return errorsmod.Wrap( types.ErrInvalidContract,