From 4a3adac6a6bd65fe032c3a9e918651437760a7e8 Mon Sep 17 00:00:00 2001 From: lumtis Date: Mon, 13 Jan 2025 16:23:07 +0100 Subject: [PATCH 01/11] update contracts --- pkg/contracts/testdappv2/TestDAppV2.bin | 2 +- pkg/contracts/testdappv2/TestDAppV2.go | 2 +- pkg/contracts/testdappv2/TestDAppV2.json | 2 +- pkg/contracts/testdappv2/TestDAppV2.sol | 44 ++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 3 deletions(-) diff --git a/pkg/contracts/testdappv2/TestDAppV2.bin b/pkg/contracts/testdappv2/TestDAppV2.bin index 5455aed4f7..71cbe43269 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.bin +++ b/pkg/contracts/testdappv2/TestDAppV2.bin @@ -1 +1 @@ -60c060405234801561001057600080fd5b50604051611ebb380380611ebb83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a051611d116101aa6000396000818161045b015281816104d40152818161084e0152610c730152600081816104a90152818161082301528181610abb01528181610c240152610c480152611d116000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b9190611005565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061117a565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061124f565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906112e5565b6105ce565b6040516101ca919061132b565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611396565b6105e6565b005b61021660048036038101906102119190611459565b6106cc565b6040516102239190611538565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e919061117a565b6107de565b604051610260919061132b565b60405180910390f35b610283600480360381019061027e919061155a565b610821565b005b61029f600480360381019061029a919061117a565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c3919061155a565b61096c565b6040516102d591906115dc565b60405180910390f35b3480156102ea57600080fd5b506103056004803603810190610300919061163c565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906115dc565b60405180910390f35b34801561033e57600080fd5b50610359600480360381019061035491906116ca565b610ab9565b005b34801561036757600080fd5b50610370610c22565b60405161037d919061172e565b60405180910390f35b6103a0600480360381019061039b919061124f565b610c46565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906112e5565b610d6e565b6040516103d6919061172e565b60405180910390f35b3480156103eb57600080fd5b506104066004803603810190610401919061117a565b610d8e565b604051610413919061172e565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e91906117ea565b610dde565b6040516104509190611005565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b61048681610e27565b1561049057600080fd5b61049981610e7d565b6104a4816000610ed1565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610597949392919061194d565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e27565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a9919061155a565b61096c565b5b90506106ba81610e7d565b6106c48185610ed1565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a919061155a565b61096c565b5b905061074b81610e7d565b6107558134610ed1565b846000016020810190610768919061155a565b60028260405161077891906119d0565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611a3a565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c81610e27565b1561095657600080fd5b61095f81610e7d565b6109698134610ed1565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611ab2565b6040516020818303038152906040529050919050565b6109d581610e27565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ada565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611b3d565b610a6857600080fd5b610a7181610e7d565b610a7b8183610ed1565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610ae857610ae7610f13565b5b610b43818060600190610afb9190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e7d565b610ba0818060600190610b569190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610ed1565b806000016020810190610bb3919061155a565b6002828060600190610bc59190611b79565b604051610bd3929190611c01565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610c7157600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b8152600401610d37949392919061194d565b6000604051808303818588803b158015610d5057600080fd5b505af1158015610d64573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b60006001600083604051602001610da59190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000604051602001610e3890611c66565b6040516020818303038152906040528051906020012082604051602001610e5f9190611a23565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610e939190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610ee79190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e20905060008183610f309190611caa565b905060005b81811015610f735760008190806001815401808255809150506001900390600052602060002001600090919091909150558080600101915050610f35565b50600080610f819190610f86565b505050565b5080546000825590600052602060002090810190610fa49190610fa7565b50565b5b80821115610fc0576000816000905550600101610fa8565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610fef82610fc4565b9050919050565b610fff81610fe4565b82525050565b600060208201905061101a6000830184610ff6565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6110878261103e565b810181811067ffffffffffffffff821117156110a6576110a561104f565b5b80604052505050565b60006110b9611020565b90506110c5828261107e565b919050565b600067ffffffffffffffff8211156110e5576110e461104f565b5b6110ee8261103e565b9050602081019050919050565b82818337600083830152505050565b600061111d611118846110ca565b6110af565b90508281526020810184848401111561113957611138611039565b5b6111448482856110fb565b509392505050565b600082601f83011261116157611160611034565b5b813561117184826020860161110a565b91505092915050565b6000602082840312156111905761118f61102a565b5b600082013567ffffffffffffffff8111156111ae576111ad61102f565b5b6111ba8482850161114c565b91505092915050565b6111cc81610fe4565b81146111d757600080fd5b50565b6000813590506111e9816111c3565b92915050565b600080fd5b600080fd5b60008083601f84011261120f5761120e611034565b5b8235905067ffffffffffffffff81111561122c5761122b6111ef565b5b602083019150836001820283011115611248576112476111f4565b5b9250929050565b6000806000604084860312156112685761126761102a565b5b6000611276868287016111da565b935050602084013567ffffffffffffffff8111156112975761129661102f565b5b6112a3868287016111f9565b92509250509250925092565b6000819050919050565b6112c2816112af565b81146112cd57600080fd5b50565b6000813590506112df816112b9565b92915050565b6000602082840312156112fb576112fa61102a565b5b6000611309848285016112d0565b91505092915050565b6000819050919050565b61132581611312565b82525050565b6000602082019050611340600083018461131c565b92915050565b600080fd5b60006060828403121561136157611360611346565b5b81905092915050565b61137381611312565b811461137e57600080fd5b50565b6000813590506113908161136a565b92915050565b6000806000806000608086880312156113b2576113b161102a565b5b600086013567ffffffffffffffff8111156113d0576113cf61102f565b5b6113dc8882890161134b565b95505060206113ed888289016111da565b94505060406113fe88828901611381565b935050606086013567ffffffffffffffff81111561141f5761141e61102f565b5b61142b888289016111f9565b92509250509295509295909350565b6000602082840312156114505761144f611346565b5b81905092915050565b6000806000604084860312156114725761147161102a565b5b60006114808682870161143a565b935050602084013567ffffffffffffffff8111156114a1576114a061102f565b5b6114ad868287016111f9565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156114f35780820151818401526020810190506114d8565b60008484015250505050565b600061150a826114b9565b61151481856114c4565b93506115248185602086016114d5565b61152d8161103e565b840191505092915050565b6000602082019050818103600083015261155281846114ff565b905092915050565b6000602082840312156115705761156f61102a565b5b600061157e848285016111da565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006115ae82611587565b6115b88185611592565b93506115c88185602086016114d5565b6115d18161103e565b840191505092915050565b600060208201905081810360008301526115f681846115a3565b905092915050565b600061160982610fe4565b9050919050565b611619816115fe565b811461162457600080fd5b50565b60008135905061163681611610565b92915050565b6000806000606084860312156116555761165461102a565b5b600061166386828701611627565b935050602061167486828701611381565b925050604084013567ffffffffffffffff8111156116955761169461102f565b5b6116a18682870161114c565b9150509250925092565b6000608082840312156116c1576116c0611346565b5b81905092915050565b6000602082840312156116e0576116df61102a565b5b600082013567ffffffffffffffff8111156116fe576116fd61102f565b5b61170a848285016116ab565b91505092915050565b60008115159050919050565b61172881611713565b82525050565b6000602082019050611743600083018461171f565b92915050565b600067ffffffffffffffff8211156117645761176361104f565b5b61176d8261103e565b9050602081019050919050565b600061178d61178884611749565b6110af565b9050828152602081018484840111156117a9576117a8611039565b5b6117b48482856110fb565b509392505050565b600082601f8301126117d1576117d0611034565b5b81356117e184826020860161177a565b91505092915050565b600060208284031215611800576117ff61102a565b5b600082013567ffffffffffffffff81111561181e5761181d61102f565b5b61182a848285016117bc565b91505092915050565b600061183f83856114c4565b935061184c8385846110fb565b6118558361103e565b840190509392505050565b61186981610fe4565b82525050565b61187881611713565b82525050565b600082825260208201905092915050565b600061189a826114b9565b6118a4818561187e565b93506118b48185602086016114d5565b6118bd8161103e565b840191505092915050565b6118d181611312565b82525050565b600060a0830160008301516118ef6000860182611860565b506020830151611902602086018261186f565b5060408301516119156040860182611860565b506060830151848203606086015261192d828261188f565b915050608083015161194260808601826118c8565b508091505092915050565b60006060820190506119626000830187610ff6565b8181036020830152611975818587611833565b9050818103604083015261198981846118d7565b905095945050505050565b600081905092915050565b60006119aa826114b9565b6119b48185611994565b93506119c48185602086016114d5565b80840191505092915050565b60006119dc828461199f565b915081905092915050565b600081905092915050565b60006119fd82611587565b611a0781856119e7565b9350611a178185602086016114d5565b80840191505092915050565b6000611a2f82846119f2565b915081905092915050565b6000604082019050611a4f6000830185610ff6565b8181036020830152611a6181846118d7565b90509392505050565b60008160601b9050919050565b6000611a8282611a6a565b9050919050565b6000611a9482611a77565b9050919050565b611aac611aa782610fe4565b611a89565b82525050565b6000611abe82856119f2565b9150611aca8284611a9b565b6014820191508190509392505050565b6000606082019050611aef6000830186610ff6565b611afc6020830185610ff6565b611b09604083018461131c565b949350505050565b611b1a81611713565b8114611b2557600080fd5b50565b600081519050611b3781611b11565b92915050565b600060208284031215611b5357611b5261102a565b5b6000611b6184828501611b28565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611b9657611b95611b6a565b5b80840192508235915067ffffffffffffffff821115611bb857611bb7611b6f565b5b602083019250600182023603831315611bd457611bd3611b74565b5b509250929050565b6000611be88385611994565b9350611bf58385846110fb565b82840190509392505050565b6000611c0e828486611bdc565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000611c506006836119e7565b9150611c5b82611c1a565b600682019050919050565b6000611c7182611c43565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611cb582611312565b9150611cc083611312565b925082611cd057611ccf611c7b565b5b82820490509291505056fea2646970667358221220c65e0c220554f807998419d73152c256b7cda9add6caf7336e420daca02bf0cf64736f6c634300081a0033 +60c060405234801561001057600080fd5b5060405161252f38038061252f83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a0516123856101aa6000396000818161045b015281816104d40152818161084e0152610fe90152600081816104a90152818161082301528181610abb01528181610f9a0152610fbe01526123856000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b91906113d1565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611546565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061161b565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906116b1565b6105ce565b6040516101ca91906116f7565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611762565b6105e6565b005b61021660048036038101906102119190611825565b6106cc565b6040516102239190611904565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190611546565b6107de565b60405161026091906116f7565b60405180910390f35b610283600480360381019061027e9190611926565b610821565b005b61029f600480360381019061029a9190611546565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c39190611926565b61096c565b6040516102d591906119a8565b60405180910390f35b3480156102ea57600080fd5b5061030560048036038101906103009190611a08565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906119a8565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190611a96565b610ab9565b005b34801561036757600080fd5b50610370610f98565b60405161037d9190611afa565b60405180910390f35b6103a0600480360381019061039b919061161b565b610fbc565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906116b1565b6110e4565b6040516103d69190611afa565b60405180910390f35b3480156103eb57600080fd5b5061040660048036038101906104019190611546565b611104565b6040516104139190611afa565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e9190611bb6565b611154565b60405161045091906113d1565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b6104868161119d565b1561049057600080fd5b610499816111f3565b6104a4816000611247565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b81526004016105979493929190611d19565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061119d565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a99190611926565b61096c565b5b90506106ba816111f3565b6106c48185611247565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a9190611926565b61096c565b5b905061074b816111f3565b6107558134611247565b8460000160208101906107689190611926565b6002826040516107789190611d9c565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611def565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611e06565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c8161119d565b1561095657600080fd5b61095f816111f3565b6109698134611247565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611e7e565b6040516020818303038152906040529050919050565b6109d58161119d565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ea6565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611f09565b610a6857600080fd5b610a71816111f3565b610a7b8183611247565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610e5e57610ae7611289565b610b42818060600190610afa9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506112fc565b15610e5d57600080826020016020810190610b5d9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663d9eeebed6040518163ffffffff1660e01b81526004016040805180830381865afa158015610ba6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bca9190611fd2565b91509150826020016020810190610be19190611926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c459061205e565b60405180910390fd5b8260400135811115610c95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8c906120f0565b60405180910390fd5b6000818460400135610ca7919061213f565b9050836020016020810190610cbc9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b33386604001356040518363ffffffff1660e01b8152600401610cfa929190612173565b6020604051808303816000875af1158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190611f09565b503373ffffffffffffffffffffffffffffffffffffffff16637c0dcb5f856000016020810190610d6d9190611926565b604051602001610d7d91906113d1565b60405160208183030381529060405283876020016020810190610da09190611926565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610e27949392919061219c565b600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050505050505b5b610eb9818060600190610e719190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506111f3565b610f16818060600190610ecc9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000611247565b806000016020810190610f299190611926565b6002828060600190610f3b9190611f45565b604051610f49929190612214565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610fe757600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b81526004016110ad9493929190611d19565b6000604051808303818588803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161111b9190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016111ae90612279565b60405160208183030381529060405280519060200120826040516020016111d59190611def565b60405160208183030381529060405280519060200120149050919050565b6001806000836040516020016112099190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600360008460405160200161125d9190611def565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e209050600081836112a691906122bd565b905060005b818110156112e957600081908060018154018082558091505060019003906000526020600020016000909190919091505580806001019150506112ab565b506000806112f79190611352565b505050565b600060405160200161130d9061233a565b60405160208183030381529060405280519060200120826040516020016113349190611def565b60405160208183030381529060405280519060200120149050919050565b50805460008255906000526020600020908101906113709190611373565b50565b5b8082111561138c576000816000905550600101611374565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113bb82611390565b9050919050565b6113cb816113b0565b82525050565b60006020820190506113e660008301846113c2565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6114538261140a565b810181811067ffffffffffffffff821117156114725761147161141b565b5b80604052505050565b60006114856113ec565b9050611491828261144a565b919050565b600067ffffffffffffffff8211156114b1576114b061141b565b5b6114ba8261140a565b9050602081019050919050565b82818337600083830152505050565b60006114e96114e484611496565b61147b565b90508281526020810184848401111561150557611504611405565b5b6115108482856114c7565b509392505050565b600082601f83011261152d5761152c611400565b5b813561153d8482602086016114d6565b91505092915050565b60006020828403121561155c5761155b6113f6565b5b600082013567ffffffffffffffff81111561157a576115796113fb565b5b61158684828501611518565b91505092915050565b611598816113b0565b81146115a357600080fd5b50565b6000813590506115b58161158f565b92915050565b600080fd5b600080fd5b60008083601f8401126115db576115da611400565b5b8235905067ffffffffffffffff8111156115f8576115f76115bb565b5b602083019150836001820283011115611614576116136115c0565b5b9250929050565b600080600060408486031215611634576116336113f6565b5b6000611642868287016115a6565b935050602084013567ffffffffffffffff811115611663576116626113fb565b5b61166f868287016115c5565b92509250509250925092565b6000819050919050565b61168e8161167b565b811461169957600080fd5b50565b6000813590506116ab81611685565b92915050565b6000602082840312156116c7576116c66113f6565b5b60006116d58482850161169c565b91505092915050565b6000819050919050565b6116f1816116de565b82525050565b600060208201905061170c60008301846116e8565b92915050565b600080fd5b60006060828403121561172d5761172c611712565b5b81905092915050565b61173f816116de565b811461174a57600080fd5b50565b60008135905061175c81611736565b92915050565b60008060008060006080868803121561177e5761177d6113f6565b5b600086013567ffffffffffffffff81111561179c5761179b6113fb565b5b6117a888828901611717565b95505060206117b9888289016115a6565b94505060406117ca8882890161174d565b935050606086013567ffffffffffffffff8111156117eb576117ea6113fb565b5b6117f7888289016115c5565b92509250509295509295909350565b60006020828403121561181c5761181b611712565b5b81905092915050565b60008060006040848603121561183e5761183d6113f6565b5b600061184c86828701611806565b935050602084013567ffffffffffffffff81111561186d5761186c6113fb565b5b611879868287016115c5565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156118bf5780820151818401526020810190506118a4565b60008484015250505050565b60006118d682611885565b6118e08185611890565b93506118f08185602086016118a1565b6118f98161140a565b840191505092915050565b6000602082019050818103600083015261191e81846118cb565b905092915050565b60006020828403121561193c5761193b6113f6565b5b600061194a848285016115a6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b600061197a82611953565b611984818561195e565b93506119948185602086016118a1565b61199d8161140a565b840191505092915050565b600060208201905081810360008301526119c2818461196f565b905092915050565b60006119d5826113b0565b9050919050565b6119e5816119ca565b81146119f057600080fd5b50565b600081359050611a02816119dc565b92915050565b600080600060608486031215611a2157611a206113f6565b5b6000611a2f868287016119f3565b9350506020611a408682870161174d565b925050604084013567ffffffffffffffff811115611a6157611a606113fb565b5b611a6d86828701611518565b9150509250925092565b600060808284031215611a8d57611a8c611712565b5b81905092915050565b600060208284031215611aac57611aab6113f6565b5b600082013567ffffffffffffffff811115611aca57611ac96113fb565b5b611ad684828501611a77565b91505092915050565b60008115159050919050565b611af481611adf565b82525050565b6000602082019050611b0f6000830184611aeb565b92915050565b600067ffffffffffffffff821115611b3057611b2f61141b565b5b611b398261140a565b9050602081019050919050565b6000611b59611b5484611b15565b61147b565b905082815260208101848484011115611b7557611b74611405565b5b611b808482856114c7565b509392505050565b600082601f830112611b9d57611b9c611400565b5b8135611bad848260208601611b46565b91505092915050565b600060208284031215611bcc57611bcb6113f6565b5b600082013567ffffffffffffffff811115611bea57611be96113fb565b5b611bf684828501611b88565b91505092915050565b6000611c0b8385611890565b9350611c188385846114c7565b611c218361140a565b840190509392505050565b611c35816113b0565b82525050565b611c4481611adf565b82525050565b600082825260208201905092915050565b6000611c6682611885565b611c708185611c4a565b9350611c808185602086016118a1565b611c898161140a565b840191505092915050565b611c9d816116de565b82525050565b600060a083016000830151611cbb6000860182611c2c565b506020830151611cce6020860182611c3b565b506040830151611ce16040860182611c2c565b5060608301518482036060860152611cf98282611c5b565b9150506080830151611d0e6080860182611c94565b508091505092915050565b6000606082019050611d2e60008301876113c2565b8181036020830152611d41818587611bff565b90508181036040830152611d558184611ca3565b905095945050505050565b600081905092915050565b6000611d7682611885565b611d808185611d60565b9350611d908185602086016118a1565b80840191505092915050565b6000611da88284611d6b565b915081905092915050565b600081905092915050565b6000611dc982611953565b611dd38185611db3565b9350611de38185602086016118a1565b80840191505092915050565b6000611dfb8284611dbe565b915081905092915050565b6000604082019050611e1b60008301856113c2565b8181036020830152611e2d8184611ca3565b90509392505050565b60008160601b9050919050565b6000611e4e82611e36565b9050919050565b6000611e6082611e43565b9050919050565b611e78611e73826113b0565b611e55565b82525050565b6000611e8a8285611dbe565b9150611e968284611e67565b6014820191508190509392505050565b6000606082019050611ebb60008301866113c2565b611ec860208301856113c2565b611ed560408301846116e8565b949350505050565b611ee681611adf565b8114611ef157600080fd5b50565b600081519050611f0381611edd565b92915050565b600060208284031215611f1f57611f1e6113f6565b5b6000611f2d84828501611ef4565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611f6257611f61611f36565b5b80840192508235915067ffffffffffffffff821115611f8457611f83611f3b565b5b602083019250600182023603831315611fa057611f9f611f40565b5b509250929050565b600081519050611fb78161158f565b92915050565b600081519050611fcc81611736565b92915050565b60008060408385031215611fe957611fe86113f6565b5b6000611ff785828601611fa8565b925050602061200885828601611fbd565b9150509250929050565b7f7a72633230206973206e6f742067617320746f6b656e00000000000000000000600082015250565b600061204860168361195e565b915061205382612012565b602082019050919050565b600060208201905081810360008301526120778161203b565b9050919050565b7f66656520616d6f756e7420697320686967686572207468616e2074686520616d60008201527f6f756e7400000000000000000000000000000000000000000000000000000000602082015250565b60006120da60248361195e565b91506120e58261207e565b604082019050919050565b60006020820190508181036000830152612109816120cd565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061214a826116de565b9150612155836116de565b925082820390508181111561216d5761216c612110565b5b92915050565b600060408201905061218860008301856113c2565b61219560208301846116e8565b9392505050565b600060808201905081810360008301526121b681876118cb565b90506121c560208301866116e8565b6121d260408301856113c2565b81810360608301526121e48184611ca3565b905095945050505050565b60006121fb8385611d60565b93506122088385846114c7565b82840190509392505050565b60006122218284866121ef565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000612263600683611db3565b915061226e8261222d565b600682019050919050565b600061228482612256565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006122c8826116de565b91506122d3836116de565b9250826122e3576122e261228e565b5b828204905092915050565b7f7769746864726177000000000000000000000000000000000000000000000000600082015250565b6000612324600883611db3565b915061232f826122ee565b600882019050919050565b600061234582612317565b915081905091905056fea2646970667358221220cc1d392f0803f3c30b8da3699bebbbdf5e1711d9c77c2bd74f9a96c12336d8f564736f6c634300081a0033 diff --git a/pkg/contracts/testdappv2/TestDAppV2.go b/pkg/contracts/testdappv2/TestDAppV2.go index 55b397cbd3..4c580efc3a 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.go +++ b/pkg/contracts/testdappv2/TestDAppV2.go @@ -52,7 +52,7 @@ type TestDAppV2zContext struct { // TestDAppV2MetaData contains all meta data concerning the TestDAppV2 contract. var TestDAppV2MetaData = &bind.MetaData{ ABI: "[{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"isZetaChain_\",\"type\":\"bool\"},{\"internalType\":\"address\",\"name\":\"gateway_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"NO_MESSAGE_CALL\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"amountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"calledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"erc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"erc20Call\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"gasCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"gateway\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"gatewayCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"}],\"name\":\"gatewayDeposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"dst\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"payload\",\"type\":\"bytes\"}],\"name\":\"gatewayDepositAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getAmountWithMessage\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"getCalledWithMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"getNoMessageIndex\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isZetaChain\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes\",\"name\":\"origin\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"chainID\",\"type\":\"uint256\"}],\"internalType\":\"structTestDAppV2.zContext\",\"name\":\"_context\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"_zrc20\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"onCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"internalType\":\"structTestDAppV2.MessageContext\",\"name\":\"messageContext\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"onCall\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"asset\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"revertMessage\",\"type\":\"bytes\"}],\"internalType\":\"structTestDAppV2.RevertContext\",\"name\":\"revertContext\",\"type\":\"tuple\"}],\"name\":\"onRevert\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"senderWithMessage\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"message\",\"type\":\"string\"}],\"name\":\"simpleCall\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]", - Bin: "0x60c060405234801561001057600080fd5b50604051611ebb380380611ebb83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a051611d116101aa6000396000818161045b015281816104d40152818161084e0152610c730152600081816104a90152818161082301528181610abb01528181610c240152610c480152611d116000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b9190611005565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061117a565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061124f565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906112e5565b6105ce565b6040516101ca919061132b565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611396565b6105e6565b005b61021660048036038101906102119190611459565b6106cc565b6040516102239190611538565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e919061117a565b6107de565b604051610260919061132b565b60405180910390f35b610283600480360381019061027e919061155a565b610821565b005b61029f600480360381019061029a919061117a565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c3919061155a565b61096c565b6040516102d591906115dc565b60405180910390f35b3480156102ea57600080fd5b506103056004803603810190610300919061163c565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906115dc565b60405180910390f35b34801561033e57600080fd5b50610359600480360381019061035491906116ca565b610ab9565b005b34801561036757600080fd5b50610370610c22565b60405161037d919061172e565b60405180910390f35b6103a0600480360381019061039b919061124f565b610c46565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906112e5565b610d6e565b6040516103d6919061172e565b60405180910390f35b3480156103eb57600080fd5b506104066004803603810190610401919061117a565b610d8e565b604051610413919061172e565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e91906117ea565b610dde565b6040516104509190611005565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b61048681610e27565b1561049057600080fd5b61049981610e7d565b6104a4816000610ed1565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610597949392919061194d565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e27565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a9919061155a565b61096c565b5b90506106ba81610e7d565b6106c48185610ed1565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a919061155a565b61096c565b5b905061074b81610e7d565b6107558134610ed1565b846000016020810190610768919061155a565b60028260405161077891906119d0565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611a3a565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c81610e27565b1561095657600080fd5b61095f81610e7d565b6109698134610ed1565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611ab2565b6040516020818303038152906040529050919050565b6109d581610e27565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ada565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611b3d565b610a6857600080fd5b610a7181610e7d565b610a7b8183610ed1565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610ae857610ae7610f13565b5b610b43818060600190610afb9190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e7d565b610ba0818060600190610b569190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610ed1565b806000016020810190610bb3919061155a565b6002828060600190610bc59190611b79565b604051610bd3929190611c01565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610c7157600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b8152600401610d37949392919061194d565b6000604051808303818588803b158015610d5057600080fd5b505af1158015610d64573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b60006001600083604051602001610da59190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000604051602001610e3890611c66565b6040516020818303038152906040528051906020012082604051602001610e5f9190611a23565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610e939190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610ee79190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e20905060008183610f309190611caa565b905060005b81811015610f735760008190806001815401808255809150506001900390600052602060002001600090919091909150558080600101915050610f35565b50600080610f819190610f86565b505050565b5080546000825590600052602060002090810190610fa49190610fa7565b50565b5b80821115610fc0576000816000905550600101610fa8565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610fef82610fc4565b9050919050565b610fff81610fe4565b82525050565b600060208201905061101a6000830184610ff6565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6110878261103e565b810181811067ffffffffffffffff821117156110a6576110a561104f565b5b80604052505050565b60006110b9611020565b90506110c5828261107e565b919050565b600067ffffffffffffffff8211156110e5576110e461104f565b5b6110ee8261103e565b9050602081019050919050565b82818337600083830152505050565b600061111d611118846110ca565b6110af565b90508281526020810184848401111561113957611138611039565b5b6111448482856110fb565b509392505050565b600082601f83011261116157611160611034565b5b813561117184826020860161110a565b91505092915050565b6000602082840312156111905761118f61102a565b5b600082013567ffffffffffffffff8111156111ae576111ad61102f565b5b6111ba8482850161114c565b91505092915050565b6111cc81610fe4565b81146111d757600080fd5b50565b6000813590506111e9816111c3565b92915050565b600080fd5b600080fd5b60008083601f84011261120f5761120e611034565b5b8235905067ffffffffffffffff81111561122c5761122b6111ef565b5b602083019150836001820283011115611248576112476111f4565b5b9250929050565b6000806000604084860312156112685761126761102a565b5b6000611276868287016111da565b935050602084013567ffffffffffffffff8111156112975761129661102f565b5b6112a3868287016111f9565b92509250509250925092565b6000819050919050565b6112c2816112af565b81146112cd57600080fd5b50565b6000813590506112df816112b9565b92915050565b6000602082840312156112fb576112fa61102a565b5b6000611309848285016112d0565b91505092915050565b6000819050919050565b61132581611312565b82525050565b6000602082019050611340600083018461131c565b92915050565b600080fd5b60006060828403121561136157611360611346565b5b81905092915050565b61137381611312565b811461137e57600080fd5b50565b6000813590506113908161136a565b92915050565b6000806000806000608086880312156113b2576113b161102a565b5b600086013567ffffffffffffffff8111156113d0576113cf61102f565b5b6113dc8882890161134b565b95505060206113ed888289016111da565b94505060406113fe88828901611381565b935050606086013567ffffffffffffffff81111561141f5761141e61102f565b5b61142b888289016111f9565b92509250509295509295909350565b6000602082840312156114505761144f611346565b5b81905092915050565b6000806000604084860312156114725761147161102a565b5b60006114808682870161143a565b935050602084013567ffffffffffffffff8111156114a1576114a061102f565b5b6114ad868287016111f9565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156114f35780820151818401526020810190506114d8565b60008484015250505050565b600061150a826114b9565b61151481856114c4565b93506115248185602086016114d5565b61152d8161103e565b840191505092915050565b6000602082019050818103600083015261155281846114ff565b905092915050565b6000602082840312156115705761156f61102a565b5b600061157e848285016111da565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006115ae82611587565b6115b88185611592565b93506115c88185602086016114d5565b6115d18161103e565b840191505092915050565b600060208201905081810360008301526115f681846115a3565b905092915050565b600061160982610fe4565b9050919050565b611619816115fe565b811461162457600080fd5b50565b60008135905061163681611610565b92915050565b6000806000606084860312156116555761165461102a565b5b600061166386828701611627565b935050602061167486828701611381565b925050604084013567ffffffffffffffff8111156116955761169461102f565b5b6116a18682870161114c565b9150509250925092565b6000608082840312156116c1576116c0611346565b5b81905092915050565b6000602082840312156116e0576116df61102a565b5b600082013567ffffffffffffffff8111156116fe576116fd61102f565b5b61170a848285016116ab565b91505092915050565b60008115159050919050565b61172881611713565b82525050565b6000602082019050611743600083018461171f565b92915050565b600067ffffffffffffffff8211156117645761176361104f565b5b61176d8261103e565b9050602081019050919050565b600061178d61178884611749565b6110af565b9050828152602081018484840111156117a9576117a8611039565b5b6117b48482856110fb565b509392505050565b600082601f8301126117d1576117d0611034565b5b81356117e184826020860161177a565b91505092915050565b600060208284031215611800576117ff61102a565b5b600082013567ffffffffffffffff81111561181e5761181d61102f565b5b61182a848285016117bc565b91505092915050565b600061183f83856114c4565b935061184c8385846110fb565b6118558361103e565b840190509392505050565b61186981610fe4565b82525050565b61187881611713565b82525050565b600082825260208201905092915050565b600061189a826114b9565b6118a4818561187e565b93506118b48185602086016114d5565b6118bd8161103e565b840191505092915050565b6118d181611312565b82525050565b600060a0830160008301516118ef6000860182611860565b506020830151611902602086018261186f565b5060408301516119156040860182611860565b506060830151848203606086015261192d828261188f565b915050608083015161194260808601826118c8565b508091505092915050565b60006060820190506119626000830187610ff6565b8181036020830152611975818587611833565b9050818103604083015261198981846118d7565b905095945050505050565b600081905092915050565b60006119aa826114b9565b6119b48185611994565b93506119c48185602086016114d5565b80840191505092915050565b60006119dc828461199f565b915081905092915050565b600081905092915050565b60006119fd82611587565b611a0781856119e7565b9350611a178185602086016114d5565b80840191505092915050565b6000611a2f82846119f2565b915081905092915050565b6000604082019050611a4f6000830185610ff6565b8181036020830152611a6181846118d7565b90509392505050565b60008160601b9050919050565b6000611a8282611a6a565b9050919050565b6000611a9482611a77565b9050919050565b611aac611aa782610fe4565b611a89565b82525050565b6000611abe82856119f2565b9150611aca8284611a9b565b6014820191508190509392505050565b6000606082019050611aef6000830186610ff6565b611afc6020830185610ff6565b611b09604083018461131c565b949350505050565b611b1a81611713565b8114611b2557600080fd5b50565b600081519050611b3781611b11565b92915050565b600060208284031215611b5357611b5261102a565b5b6000611b6184828501611b28565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611b9657611b95611b6a565b5b80840192508235915067ffffffffffffffff821115611bb857611bb7611b6f565b5b602083019250600182023603831315611bd457611bd3611b74565b5b509250929050565b6000611be88385611994565b9350611bf58385846110fb565b82840190509392505050565b6000611c0e828486611bdc565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000611c506006836119e7565b9150611c5b82611c1a565b600682019050919050565b6000611c7182611c43565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611cb582611312565b9150611cc083611312565b925082611cd057611ccf611c7b565b5b82820490509291505056fea2646970667358221220c65e0c220554f807998419d73152c256b7cda9add6caf7336e420daca02bf0cf64736f6c634300081a0033", + Bin: "0x60c060405234801561001057600080fd5b5060405161252f38038061252f83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a0516123856101aa6000396000818161045b015281816104d40152818161084e0152610fe90152600081816104a90152818161082301528181610abb01528181610f9a0152610fbe01526123856000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b91906113d1565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611546565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061161b565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906116b1565b6105ce565b6040516101ca91906116f7565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611762565b6105e6565b005b61021660048036038101906102119190611825565b6106cc565b6040516102239190611904565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190611546565b6107de565b60405161026091906116f7565b60405180910390f35b610283600480360381019061027e9190611926565b610821565b005b61029f600480360381019061029a9190611546565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c39190611926565b61096c565b6040516102d591906119a8565b60405180910390f35b3480156102ea57600080fd5b5061030560048036038101906103009190611a08565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906119a8565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190611a96565b610ab9565b005b34801561036757600080fd5b50610370610f98565b60405161037d9190611afa565b60405180910390f35b6103a0600480360381019061039b919061161b565b610fbc565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906116b1565b6110e4565b6040516103d69190611afa565b60405180910390f35b3480156103eb57600080fd5b5061040660048036038101906104019190611546565b611104565b6040516104139190611afa565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e9190611bb6565b611154565b60405161045091906113d1565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b6104868161119d565b1561049057600080fd5b610499816111f3565b6104a4816000611247565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b81526004016105979493929190611d19565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061119d565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a99190611926565b61096c565b5b90506106ba816111f3565b6106c48185611247565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a9190611926565b61096c565b5b905061074b816111f3565b6107558134611247565b8460000160208101906107689190611926565b6002826040516107789190611d9c565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611def565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611e06565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c8161119d565b1561095657600080fd5b61095f816111f3565b6109698134611247565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611e7e565b6040516020818303038152906040529050919050565b6109d58161119d565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ea6565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611f09565b610a6857600080fd5b610a71816111f3565b610a7b8183611247565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610e5e57610ae7611289565b610b42818060600190610afa9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506112fc565b15610e5d57600080826020016020810190610b5d9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663d9eeebed6040518163ffffffff1660e01b81526004016040805180830381865afa158015610ba6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bca9190611fd2565b91509150826020016020810190610be19190611926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c459061205e565b60405180910390fd5b8260400135811115610c95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8c906120f0565b60405180910390fd5b6000818460400135610ca7919061213f565b9050836020016020810190610cbc9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b33386604001356040518363ffffffff1660e01b8152600401610cfa929190612173565b6020604051808303816000875af1158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190611f09565b503373ffffffffffffffffffffffffffffffffffffffff16637c0dcb5f856000016020810190610d6d9190611926565b604051602001610d7d91906113d1565b60405160208183030381529060405283876020016020810190610da09190611926565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610e27949392919061219c565b600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050505050505b5b610eb9818060600190610e719190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506111f3565b610f16818060600190610ecc9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000611247565b806000016020810190610f299190611926565b6002828060600190610f3b9190611f45565b604051610f49929190612214565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610fe757600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b81526004016110ad9493929190611d19565b6000604051808303818588803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161111b9190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016111ae90612279565b60405160208183030381529060405280519060200120826040516020016111d59190611def565b60405160208183030381529060405280519060200120149050919050565b6001806000836040516020016112099190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600360008460405160200161125d9190611def565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e209050600081836112a691906122bd565b905060005b818110156112e957600081908060018154018082558091505060019003906000526020600020016000909190919091505580806001019150506112ab565b506000806112f79190611352565b505050565b600060405160200161130d9061233a565b60405160208183030381529060405280519060200120826040516020016113349190611def565b60405160208183030381529060405280519060200120149050919050565b50805460008255906000526020600020908101906113709190611373565b50565b5b8082111561138c576000816000905550600101611374565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113bb82611390565b9050919050565b6113cb816113b0565b82525050565b60006020820190506113e660008301846113c2565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6114538261140a565b810181811067ffffffffffffffff821117156114725761147161141b565b5b80604052505050565b60006114856113ec565b9050611491828261144a565b919050565b600067ffffffffffffffff8211156114b1576114b061141b565b5b6114ba8261140a565b9050602081019050919050565b82818337600083830152505050565b60006114e96114e484611496565b61147b565b90508281526020810184848401111561150557611504611405565b5b6115108482856114c7565b509392505050565b600082601f83011261152d5761152c611400565b5b813561153d8482602086016114d6565b91505092915050565b60006020828403121561155c5761155b6113f6565b5b600082013567ffffffffffffffff81111561157a576115796113fb565b5b61158684828501611518565b91505092915050565b611598816113b0565b81146115a357600080fd5b50565b6000813590506115b58161158f565b92915050565b600080fd5b600080fd5b60008083601f8401126115db576115da611400565b5b8235905067ffffffffffffffff8111156115f8576115f76115bb565b5b602083019150836001820283011115611614576116136115c0565b5b9250929050565b600080600060408486031215611634576116336113f6565b5b6000611642868287016115a6565b935050602084013567ffffffffffffffff811115611663576116626113fb565b5b61166f868287016115c5565b92509250509250925092565b6000819050919050565b61168e8161167b565b811461169957600080fd5b50565b6000813590506116ab81611685565b92915050565b6000602082840312156116c7576116c66113f6565b5b60006116d58482850161169c565b91505092915050565b6000819050919050565b6116f1816116de565b82525050565b600060208201905061170c60008301846116e8565b92915050565b600080fd5b60006060828403121561172d5761172c611712565b5b81905092915050565b61173f816116de565b811461174a57600080fd5b50565b60008135905061175c81611736565b92915050565b60008060008060006080868803121561177e5761177d6113f6565b5b600086013567ffffffffffffffff81111561179c5761179b6113fb565b5b6117a888828901611717565b95505060206117b9888289016115a6565b94505060406117ca8882890161174d565b935050606086013567ffffffffffffffff8111156117eb576117ea6113fb565b5b6117f7888289016115c5565b92509250509295509295909350565b60006020828403121561181c5761181b611712565b5b81905092915050565b60008060006040848603121561183e5761183d6113f6565b5b600061184c86828701611806565b935050602084013567ffffffffffffffff81111561186d5761186c6113fb565b5b611879868287016115c5565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156118bf5780820151818401526020810190506118a4565b60008484015250505050565b60006118d682611885565b6118e08185611890565b93506118f08185602086016118a1565b6118f98161140a565b840191505092915050565b6000602082019050818103600083015261191e81846118cb565b905092915050565b60006020828403121561193c5761193b6113f6565b5b600061194a848285016115a6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b600061197a82611953565b611984818561195e565b93506119948185602086016118a1565b61199d8161140a565b840191505092915050565b600060208201905081810360008301526119c2818461196f565b905092915050565b60006119d5826113b0565b9050919050565b6119e5816119ca565b81146119f057600080fd5b50565b600081359050611a02816119dc565b92915050565b600080600060608486031215611a2157611a206113f6565b5b6000611a2f868287016119f3565b9350506020611a408682870161174d565b925050604084013567ffffffffffffffff811115611a6157611a606113fb565b5b611a6d86828701611518565b9150509250925092565b600060808284031215611a8d57611a8c611712565b5b81905092915050565b600060208284031215611aac57611aab6113f6565b5b600082013567ffffffffffffffff811115611aca57611ac96113fb565b5b611ad684828501611a77565b91505092915050565b60008115159050919050565b611af481611adf565b82525050565b6000602082019050611b0f6000830184611aeb565b92915050565b600067ffffffffffffffff821115611b3057611b2f61141b565b5b611b398261140a565b9050602081019050919050565b6000611b59611b5484611b15565b61147b565b905082815260208101848484011115611b7557611b74611405565b5b611b808482856114c7565b509392505050565b600082601f830112611b9d57611b9c611400565b5b8135611bad848260208601611b46565b91505092915050565b600060208284031215611bcc57611bcb6113f6565b5b600082013567ffffffffffffffff811115611bea57611be96113fb565b5b611bf684828501611b88565b91505092915050565b6000611c0b8385611890565b9350611c188385846114c7565b611c218361140a565b840190509392505050565b611c35816113b0565b82525050565b611c4481611adf565b82525050565b600082825260208201905092915050565b6000611c6682611885565b611c708185611c4a565b9350611c808185602086016118a1565b611c898161140a565b840191505092915050565b611c9d816116de565b82525050565b600060a083016000830151611cbb6000860182611c2c565b506020830151611cce6020860182611c3b565b506040830151611ce16040860182611c2c565b5060608301518482036060860152611cf98282611c5b565b9150506080830151611d0e6080860182611c94565b508091505092915050565b6000606082019050611d2e60008301876113c2565b8181036020830152611d41818587611bff565b90508181036040830152611d558184611ca3565b905095945050505050565b600081905092915050565b6000611d7682611885565b611d808185611d60565b9350611d908185602086016118a1565b80840191505092915050565b6000611da88284611d6b565b915081905092915050565b600081905092915050565b6000611dc982611953565b611dd38185611db3565b9350611de38185602086016118a1565b80840191505092915050565b6000611dfb8284611dbe565b915081905092915050565b6000604082019050611e1b60008301856113c2565b8181036020830152611e2d8184611ca3565b90509392505050565b60008160601b9050919050565b6000611e4e82611e36565b9050919050565b6000611e6082611e43565b9050919050565b611e78611e73826113b0565b611e55565b82525050565b6000611e8a8285611dbe565b9150611e968284611e67565b6014820191508190509392505050565b6000606082019050611ebb60008301866113c2565b611ec860208301856113c2565b611ed560408301846116e8565b949350505050565b611ee681611adf565b8114611ef157600080fd5b50565b600081519050611f0381611edd565b92915050565b600060208284031215611f1f57611f1e6113f6565b5b6000611f2d84828501611ef4565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611f6257611f61611f36565b5b80840192508235915067ffffffffffffffff821115611f8457611f83611f3b565b5b602083019250600182023603831315611fa057611f9f611f40565b5b509250929050565b600081519050611fb78161158f565b92915050565b600081519050611fcc81611736565b92915050565b60008060408385031215611fe957611fe86113f6565b5b6000611ff785828601611fa8565b925050602061200885828601611fbd565b9150509250929050565b7f7a72633230206973206e6f742067617320746f6b656e00000000000000000000600082015250565b600061204860168361195e565b915061205382612012565b602082019050919050565b600060208201905081810360008301526120778161203b565b9050919050565b7f66656520616d6f756e7420697320686967686572207468616e2074686520616d60008201527f6f756e7400000000000000000000000000000000000000000000000000000000602082015250565b60006120da60248361195e565b91506120e58261207e565b604082019050919050565b60006020820190508181036000830152612109816120cd565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061214a826116de565b9150612155836116de565b925082820390508181111561216d5761216c612110565b5b92915050565b600060408201905061218860008301856113c2565b61219560208301846116e8565b9392505050565b600060808201905081810360008301526121b681876118cb565b90506121c560208301866116e8565b6121d260408301856113c2565b81810360608301526121e48184611ca3565b905095945050505050565b60006121fb8385611d60565b93506122088385846114c7565b82840190509392505050565b60006122218284866121ef565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000612263600683611db3565b915061226e8261222d565b600682019050919050565b600061228482612256565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006122c8826116de565b91506122d3836116de565b9250826122e3576122e261228e565b5b828204905092915050565b7f7769746864726177000000000000000000000000000000000000000000000000600082015250565b6000612324600883611db3565b915061232f826122ee565b600882019050919050565b600061234582612317565b915081905091905056fea2646970667358221220cc1d392f0803f3c30b8da3699bebbbdf5e1711d9c77c2bd74f9a96c12336d8f564736f6c634300081a0033", } // TestDAppV2ABI is the input ABI used to generate the binding from. diff --git a/pkg/contracts/testdappv2/TestDAppV2.json b/pkg/contracts/testdappv2/TestDAppV2.json index 41a2d6017d..97604c40a9 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.json +++ b/pkg/contracts/testdappv2/TestDAppV2.json @@ -383,5 +383,5 @@ "type": "receive" } ], - "bin": "60c060405234801561001057600080fd5b50604051611ebb380380611ebb83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a051611d116101aa6000396000818161045b015281816104d40152818161084e0152610c730152600081816104a90152818161082301528181610abb01528181610c240152610c480152611d116000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b9190611005565b60405180910390f35b34801561015057600080fd5b5061016b6004803603810190610166919061117a565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061124f565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906112e5565b6105ce565b6040516101ca919061132b565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611396565b6105e6565b005b61021660048036038101906102119190611459565b6106cc565b6040516102239190611538565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e919061117a565b6107de565b604051610260919061132b565b60405180910390f35b610283600480360381019061027e919061155a565b610821565b005b61029f600480360381019061029a919061117a565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c3919061155a565b61096c565b6040516102d591906115dc565b60405180910390f35b3480156102ea57600080fd5b506103056004803603810190610300919061163c565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906115dc565b60405180910390f35b34801561033e57600080fd5b50610359600480360381019061035491906116ca565b610ab9565b005b34801561036757600080fd5b50610370610c22565b60405161037d919061172e565b60405180910390f35b6103a0600480360381019061039b919061124f565b610c46565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906112e5565b610d6e565b6040516103d6919061172e565b60405180910390f35b3480156103eb57600080fd5b506104066004803603810190610401919061117a565b610d8e565b604051610413919061172e565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e91906117ea565b610dde565b6040516104509190611005565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b61048681610e27565b1561049057600080fd5b61049981610e7d565b6104a4816000610ed1565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610597949392919061194d565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e27565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a9919061155a565b61096c565b5b90506106ba81610e7d565b6106c48185610ed1565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a919061155a565b61096c565b5b905061074b81610e7d565b6107558134610ed1565b846000016020810190610768919061155a565b60028260405161077891906119d0565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611a3a565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c81610e27565b1561095657600080fd5b61095f81610e7d565b6109698134610ed1565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611ab2565b6040516020818303038152906040529050919050565b6109d581610e27565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ada565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611b3d565b610a6857600080fd5b610a7181610e7d565b610a7b8183610ed1565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610ae857610ae7610f13565b5b610b43818060600190610afb9190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610e7d565b610ba0818060600190610b569190611b79565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000610ed1565b806000016020810190610bb3919061155a565b6002828060600190610bc59190611b79565b604051610bd3929190611c01565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610c7157600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b8152600401610d37949392919061194d565b6000604051808303818588803b158015610d5057600080fd5b505af1158015610d64573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b60006001600083604051602001610da59190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6000604051602001610e3890611c66565b6040516020818303038152906040528051906020012082604051602001610e5f9190611a23565b60405160208183030381529060405280519060200120149050919050565b600180600083604051602001610e939190611a23565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b806003600084604051602001610ee79190611a23565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e20905060008183610f309190611caa565b905060005b81811015610f735760008190806001815401808255809150506001900390600052602060002001600090919091909150558080600101915050610f35565b50600080610f819190610f86565b505050565b5080546000825590600052602060002090810190610fa49190610fa7565b50565b5b80821115610fc0576000816000905550600101610fa8565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610fef82610fc4565b9050919050565b610fff81610fe4565b82525050565b600060208201905061101a6000830184610ff6565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6110878261103e565b810181811067ffffffffffffffff821117156110a6576110a561104f565b5b80604052505050565b60006110b9611020565b90506110c5828261107e565b919050565b600067ffffffffffffffff8211156110e5576110e461104f565b5b6110ee8261103e565b9050602081019050919050565b82818337600083830152505050565b600061111d611118846110ca565b6110af565b90508281526020810184848401111561113957611138611039565b5b6111448482856110fb565b509392505050565b600082601f83011261116157611160611034565b5b813561117184826020860161110a565b91505092915050565b6000602082840312156111905761118f61102a565b5b600082013567ffffffffffffffff8111156111ae576111ad61102f565b5b6111ba8482850161114c565b91505092915050565b6111cc81610fe4565b81146111d757600080fd5b50565b6000813590506111e9816111c3565b92915050565b600080fd5b600080fd5b60008083601f84011261120f5761120e611034565b5b8235905067ffffffffffffffff81111561122c5761122b6111ef565b5b602083019150836001820283011115611248576112476111f4565b5b9250929050565b6000806000604084860312156112685761126761102a565b5b6000611276868287016111da565b935050602084013567ffffffffffffffff8111156112975761129661102f565b5b6112a3868287016111f9565b92509250509250925092565b6000819050919050565b6112c2816112af565b81146112cd57600080fd5b50565b6000813590506112df816112b9565b92915050565b6000602082840312156112fb576112fa61102a565b5b6000611309848285016112d0565b91505092915050565b6000819050919050565b61132581611312565b82525050565b6000602082019050611340600083018461131c565b92915050565b600080fd5b60006060828403121561136157611360611346565b5b81905092915050565b61137381611312565b811461137e57600080fd5b50565b6000813590506113908161136a565b92915050565b6000806000806000608086880312156113b2576113b161102a565b5b600086013567ffffffffffffffff8111156113d0576113cf61102f565b5b6113dc8882890161134b565b95505060206113ed888289016111da565b94505060406113fe88828901611381565b935050606086013567ffffffffffffffff81111561141f5761141e61102f565b5b61142b888289016111f9565b92509250509295509295909350565b6000602082840312156114505761144f611346565b5b81905092915050565b6000806000604084860312156114725761147161102a565b5b60006114808682870161143a565b935050602084013567ffffffffffffffff8111156114a1576114a061102f565b5b6114ad868287016111f9565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156114f35780820151818401526020810190506114d8565b60008484015250505050565b600061150a826114b9565b61151481856114c4565b93506115248185602086016114d5565b61152d8161103e565b840191505092915050565b6000602082019050818103600083015261155281846114ff565b905092915050565b6000602082840312156115705761156f61102a565b5b600061157e848285016111da565b91505092915050565b600081519050919050565b600082825260208201905092915050565b60006115ae82611587565b6115b88185611592565b93506115c88185602086016114d5565b6115d18161103e565b840191505092915050565b600060208201905081810360008301526115f681846115a3565b905092915050565b600061160982610fe4565b9050919050565b611619816115fe565b811461162457600080fd5b50565b60008135905061163681611610565b92915050565b6000806000606084860312156116555761165461102a565b5b600061166386828701611627565b935050602061167486828701611381565b925050604084013567ffffffffffffffff8111156116955761169461102f565b5b6116a18682870161114c565b9150509250925092565b6000608082840312156116c1576116c0611346565b5b81905092915050565b6000602082840312156116e0576116df61102a565b5b600082013567ffffffffffffffff8111156116fe576116fd61102f565b5b61170a848285016116ab565b91505092915050565b60008115159050919050565b61172881611713565b82525050565b6000602082019050611743600083018461171f565b92915050565b600067ffffffffffffffff8211156117645761176361104f565b5b61176d8261103e565b9050602081019050919050565b600061178d61178884611749565b6110af565b9050828152602081018484840111156117a9576117a8611039565b5b6117b48482856110fb565b509392505050565b600082601f8301126117d1576117d0611034565b5b81356117e184826020860161177a565b91505092915050565b600060208284031215611800576117ff61102a565b5b600082013567ffffffffffffffff81111561181e5761181d61102f565b5b61182a848285016117bc565b91505092915050565b600061183f83856114c4565b935061184c8385846110fb565b6118558361103e565b840190509392505050565b61186981610fe4565b82525050565b61187881611713565b82525050565b600082825260208201905092915050565b600061189a826114b9565b6118a4818561187e565b93506118b48185602086016114d5565b6118bd8161103e565b840191505092915050565b6118d181611312565b82525050565b600060a0830160008301516118ef6000860182611860565b506020830151611902602086018261186f565b5060408301516119156040860182611860565b506060830151848203606086015261192d828261188f565b915050608083015161194260808601826118c8565b508091505092915050565b60006060820190506119626000830187610ff6565b8181036020830152611975818587611833565b9050818103604083015261198981846118d7565b905095945050505050565b600081905092915050565b60006119aa826114b9565b6119b48185611994565b93506119c48185602086016114d5565b80840191505092915050565b60006119dc828461199f565b915081905092915050565b600081905092915050565b60006119fd82611587565b611a0781856119e7565b9350611a178185602086016114d5565b80840191505092915050565b6000611a2f82846119f2565b915081905092915050565b6000604082019050611a4f6000830185610ff6565b8181036020830152611a6181846118d7565b90509392505050565b60008160601b9050919050565b6000611a8282611a6a565b9050919050565b6000611a9482611a77565b9050919050565b611aac611aa782610fe4565b611a89565b82525050565b6000611abe82856119f2565b9150611aca8284611a9b565b6014820191508190509392505050565b6000606082019050611aef6000830186610ff6565b611afc6020830185610ff6565b611b09604083018461131c565b949350505050565b611b1a81611713565b8114611b2557600080fd5b50565b600081519050611b3781611b11565b92915050565b600060208284031215611b5357611b5261102a565b5b6000611b6184828501611b28565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611b9657611b95611b6a565b5b80840192508235915067ffffffffffffffff821115611bb857611bb7611b6f565b5b602083019250600182023603831315611bd457611bd3611b74565b5b509250929050565b6000611be88385611994565b9350611bf58385846110fb565b82840190509392505050565b6000611c0e828486611bdc565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000611c506006836119e7565b9150611c5b82611c1a565b600682019050919050565b6000611c7182611c43565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000611cb582611312565b9150611cc083611312565b925082611cd057611ccf611c7b565b5b82820490509291505056fea2646970667358221220c65e0c220554f807998419d73152c256b7cda9add6caf7336e420daca02bf0cf64736f6c634300081a0033" + "bin": "60c060405234801561001057600080fd5b5060405161252f38038061252f83398181016040528101906100329190610114565b8115156080811515815250508073ffffffffffffffffffffffffffffffffffffffff1660a08173ffffffffffffffffffffffffffffffffffffffff16815250505050610154565b600080fd5b60008115159050919050565b6100938161007e565b811461009e57600080fd5b50565b6000815190506100b08161008a565b92915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006100e1826100b6565b9050919050565b6100f1816100d6565b81146100fc57600080fd5b50565b60008151905061010e816100e8565b92915050565b6000806040838503121561012b5761012a610079565b5b6000610139858286016100a1565b925050602061014a858286016100ff565b9150509250929050565b60805160a0516123856101aa6000396000818161045b015281816104d40152818161084e0152610fe90152600081816104a90152818161082301528181610abb01528181610f9a0152610fbe01526123856000f3fe60806040526004361061010d5760003560e01c8063ad23b28b11610095578063c91f356711610064578063c91f35671461035b578063deb3b1e414610386578063e2842ed7146103a2578063f592cbfb146103df578063f936ae851461041c57610114565b8063ad23b28b146102a1578063c7a339a9146102de578063c85f843414610307578063c9028a361461033257610114565b80635bcfd616116100dc5780635bcfd616146101d3578063676cc054146101fc5780639291fe261461022c5780639ca016ed14610269578063a799911f1461028557610114565b8063116191b61461011957806336e980a01461014457806341a3cd4a1461016d5780634297a2631461019657610114565b3661011457005b600080fd5b34801561012557600080fd5b5061012e610459565b60405161013b91906113d1565b60405180910390f35b34801561015057600080fd5b5061016b60048036038101906101669190611546565b61047d565b005b34801561017957600080fd5b50610194600480360381019061018f919061161b565b6104a7565b005b3480156101a257600080fd5b506101bd60048036038101906101b891906116b1565b6105ce565b6040516101ca91906116f7565b60405180910390f35b3480156101df57600080fd5b506101fa60048036038101906101f59190611762565b6105e6565b005b61021660048036038101906102119190611825565b6106cc565b6040516102239190611904565b60405180910390f35b34801561023857600080fd5b50610253600480360381019061024e9190611546565b6107de565b60405161026091906116f7565b60405180910390f35b610283600480360381019061027e9190611926565b610821565b005b61029f600480360381019061029a9190611546565b610943565b005b3480156102ad57600080fd5b506102c860048036038101906102c39190611926565b61096c565b6040516102d591906119a8565b60405180910390f35b3480156102ea57600080fd5b5061030560048036038101906103009190611a08565b6109cc565b005b34801561031357600080fd5b5061031c610a80565b60405161032991906119a8565b60405180910390f35b34801561033e57600080fd5b5061035960048036038101906103549190611a96565b610ab9565b005b34801561036757600080fd5b50610370610f98565b60405161037d9190611afa565b60405180910390f35b6103a0600480360381019061039b919061161b565b610fbc565b005b3480156103ae57600080fd5b506103c960048036038101906103c491906116b1565b6110e4565b6040516103d69190611afa565b60405180910390f35b3480156103eb57600080fd5b5061040660048036038101906104019190611546565b611104565b6040516104139190611afa565b60405180910390f35b34801561042857600080fd5b50610443600480360381019061043e9190611bb6565b611154565b60405161045091906113d1565b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000081565b6104868161119d565b1561049057600080fd5b610499816111f3565b6104a4816000611247565b50565b7f0000000000000000000000000000000000000000000000000000000000000000156104d257600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16631becceb48484846040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b81526004016105979493929190611d19565b600060405180830381600087803b1580156105b157600080fd5b505af11580156105c5573d6000803e3d6000fd5b50505050505050565b60036020528060005260406000206000915090505481565b61063382828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f8201169050808301925050505050505061119d565b1561063d57600080fd5b60008083839050146106935782828080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506106af565b6106ae8660200160208101906106a99190611926565b61096c565b5b90506106ba816111f3565b6106c48185611247565b505050505050565b606060008084849050146107245783838080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f82011690508083019250505050505050610740565b61073f85600001602081019061073a9190611926565b61096c565b5b905061074b816111f3565b6107558134611247565b8460000160208101906107689190611926565b6002826040516107789190611d9c565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550604051806020016040528060008152509150509392505050565b600060036000836040516020016107f59190611def565b604051602081830303815290604052805190602001208152602001908152602001600020549050919050565b7f00000000000000000000000000000000000000000000000000000000000000001561084c57600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663726ac97c34836040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518463ffffffff1660e01b815260040161090e929190611e06565b6000604051808303818588803b15801561092757600080fd5b505af115801561093b573d6000803e3d6000fd5b505050505050565b61094c8161119d565b1561095657600080fd5b61095f816111f3565b6109698134611247565b50565b60606040518060400160405280601681526020017f63616c6c65642077697468206e6f206d65737361676500000000000000000000815250826040516020016109b6929190611e7e565b6040516020818303038152906040529050919050565b6109d58161119d565b156109df57600080fd5b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd3330856040518463ffffffff1660e01b8152600401610a1c93929190611ea6565b6020604051808303816000875af1158015610a3b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5f9190611f09565b610a6857600080fd5b610a71816111f3565b610a7b8183611247565b505050565b6040518060400160405280601681526020017f63616c6c65642077697468206e6f206d6573736167650000000000000000000081525081565b7f000000000000000000000000000000000000000000000000000000000000000015610e5e57610ae7611289565b610b42818060600190610afa9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506112fc565b15610e5d57600080826020016020810190610b5d9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663d9eeebed6040518163ffffffff1660e01b81526004016040805180830381865afa158015610ba6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610bca9190611fd2565b91509150826020016020810190610be19190611926565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614610c4e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c459061205e565b60405180910390fd5b8260400135811115610c95576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c8c906120f0565b60405180910390fd5b6000818460400135610ca7919061213f565b9050836020016020810190610cbc9190611926565b73ffffffffffffffffffffffffffffffffffffffff1663095ea7b33386604001356040518363ffffffff1660e01b8152600401610cfa929190612173565b6020604051808303816000875af1158015610d19573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d3d9190611f09565b503373ffffffffffffffffffffffffffffffffffffffff16637c0dcb5f856000016020810190610d6d9190611926565b604051602001610d7d91906113d1565b60405160208183030381529060405283876020016020810190610da09190611926565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518563ffffffff1660e01b8152600401610e27949392919061219c565b600060405180830381600087803b158015610e4157600080fd5b505af1158015610e55573d6000803e3d6000fd5b505050505050505b5b610eb9818060600190610e719190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506111f3565b610f16818060600190610ecc9190611f45565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600081840152601f19601f820116905080830192505050505050506000611247565b806000016020810190610f299190611926565b6002828060600190610f3b9190611f45565b604051610f49929190612214565b908152602001604051809103902060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b7f000000000000000000000000000000000000000000000000000000000000000081565b7f000000000000000000000000000000000000000000000000000000000000000015610fe757600080fd5b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1663744b9b8b348585856040518060a001604052803373ffffffffffffffffffffffffffffffffffffffff168152602001600015158152602001600073ffffffffffffffffffffffffffffffffffffffff16815260200160405180602001604052806000815250815260200160008152506040518663ffffffff1660e01b81526004016110ad9493929190611d19565b6000604051808303818588803b1580156110c657600080fd5b505af11580156110da573d6000803e3d6000fd5b5050505050505050565b60016020528060005260406000206000915054906101000a900460ff1681565b6000600160008360405160200161111b9190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060009054906101000a900460ff169050919050565b6002818051602081018201805184825260208301602085012081835280955050505050506000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006040516020016111ae90612279565b60405160208183030381529060405280519060200120826040516020016111d59190611def565b60405160208183030381529060405280519060200120149050919050565b6001806000836040516020016112099190611def565b60405160208183030381529060405280519060200120815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b80600360008460405160200161125d9190611def565b604051602081830303815290604052805190602001208152602001908152602001600020819055505050565b60006207a12090506000614e209050600081836112a691906122bd565b905060005b818110156112e957600081908060018154018082558091505060019003906000526020600020016000909190919091505580806001019150506112ab565b506000806112f79190611352565b505050565b600060405160200161130d9061233a565b60405160208183030381529060405280519060200120826040516020016113349190611def565b60405160208183030381529060405280519060200120149050919050565b50805460008255906000526020600020908101906113709190611373565b50565b5b8082111561138c576000816000905550600101611374565b5090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006113bb82611390565b9050919050565b6113cb816113b0565b82525050565b60006020820190506113e660008301846113c2565b92915050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6114538261140a565b810181811067ffffffffffffffff821117156114725761147161141b565b5b80604052505050565b60006114856113ec565b9050611491828261144a565b919050565b600067ffffffffffffffff8211156114b1576114b061141b565b5b6114ba8261140a565b9050602081019050919050565b82818337600083830152505050565b60006114e96114e484611496565b61147b565b90508281526020810184848401111561150557611504611405565b5b6115108482856114c7565b509392505050565b600082601f83011261152d5761152c611400565b5b813561153d8482602086016114d6565b91505092915050565b60006020828403121561155c5761155b6113f6565b5b600082013567ffffffffffffffff81111561157a576115796113fb565b5b61158684828501611518565b91505092915050565b611598816113b0565b81146115a357600080fd5b50565b6000813590506115b58161158f565b92915050565b600080fd5b600080fd5b60008083601f8401126115db576115da611400565b5b8235905067ffffffffffffffff8111156115f8576115f76115bb565b5b602083019150836001820283011115611614576116136115c0565b5b9250929050565b600080600060408486031215611634576116336113f6565b5b6000611642868287016115a6565b935050602084013567ffffffffffffffff811115611663576116626113fb565b5b61166f868287016115c5565b92509250509250925092565b6000819050919050565b61168e8161167b565b811461169957600080fd5b50565b6000813590506116ab81611685565b92915050565b6000602082840312156116c7576116c66113f6565b5b60006116d58482850161169c565b91505092915050565b6000819050919050565b6116f1816116de565b82525050565b600060208201905061170c60008301846116e8565b92915050565b600080fd5b60006060828403121561172d5761172c611712565b5b81905092915050565b61173f816116de565b811461174a57600080fd5b50565b60008135905061175c81611736565b92915050565b60008060008060006080868803121561177e5761177d6113f6565b5b600086013567ffffffffffffffff81111561179c5761179b6113fb565b5b6117a888828901611717565b95505060206117b9888289016115a6565b94505060406117ca8882890161174d565b935050606086013567ffffffffffffffff8111156117eb576117ea6113fb565b5b6117f7888289016115c5565b92509250509295509295909350565b60006020828403121561181c5761181b611712565b5b81905092915050565b60008060006040848603121561183e5761183d6113f6565b5b600061184c86828701611806565b935050602084013567ffffffffffffffff81111561186d5761186c6113fb565b5b611879868287016115c5565b92509250509250925092565b600081519050919050565b600082825260208201905092915050565b60005b838110156118bf5780820151818401526020810190506118a4565b60008484015250505050565b60006118d682611885565b6118e08185611890565b93506118f08185602086016118a1565b6118f98161140a565b840191505092915050565b6000602082019050818103600083015261191e81846118cb565b905092915050565b60006020828403121561193c5761193b6113f6565b5b600061194a848285016115a6565b91505092915050565b600081519050919050565b600082825260208201905092915050565b600061197a82611953565b611984818561195e565b93506119948185602086016118a1565b61199d8161140a565b840191505092915050565b600060208201905081810360008301526119c2818461196f565b905092915050565b60006119d5826113b0565b9050919050565b6119e5816119ca565b81146119f057600080fd5b50565b600081359050611a02816119dc565b92915050565b600080600060608486031215611a2157611a206113f6565b5b6000611a2f868287016119f3565b9350506020611a408682870161174d565b925050604084013567ffffffffffffffff811115611a6157611a606113fb565b5b611a6d86828701611518565b9150509250925092565b600060808284031215611a8d57611a8c611712565b5b81905092915050565b600060208284031215611aac57611aab6113f6565b5b600082013567ffffffffffffffff811115611aca57611ac96113fb565b5b611ad684828501611a77565b91505092915050565b60008115159050919050565b611af481611adf565b82525050565b6000602082019050611b0f6000830184611aeb565b92915050565b600067ffffffffffffffff821115611b3057611b2f61141b565b5b611b398261140a565b9050602081019050919050565b6000611b59611b5484611b15565b61147b565b905082815260208101848484011115611b7557611b74611405565b5b611b808482856114c7565b509392505050565b600082601f830112611b9d57611b9c611400565b5b8135611bad848260208601611b46565b91505092915050565b600060208284031215611bcc57611bcb6113f6565b5b600082013567ffffffffffffffff811115611bea57611be96113fb565b5b611bf684828501611b88565b91505092915050565b6000611c0b8385611890565b9350611c188385846114c7565b611c218361140a565b840190509392505050565b611c35816113b0565b82525050565b611c4481611adf565b82525050565b600082825260208201905092915050565b6000611c6682611885565b611c708185611c4a565b9350611c808185602086016118a1565b611c898161140a565b840191505092915050565b611c9d816116de565b82525050565b600060a083016000830151611cbb6000860182611c2c565b506020830151611cce6020860182611c3b565b506040830151611ce16040860182611c2c565b5060608301518482036060860152611cf98282611c5b565b9150506080830151611d0e6080860182611c94565b508091505092915050565b6000606082019050611d2e60008301876113c2565b8181036020830152611d41818587611bff565b90508181036040830152611d558184611ca3565b905095945050505050565b600081905092915050565b6000611d7682611885565b611d808185611d60565b9350611d908185602086016118a1565b80840191505092915050565b6000611da88284611d6b565b915081905092915050565b600081905092915050565b6000611dc982611953565b611dd38185611db3565b9350611de38185602086016118a1565b80840191505092915050565b6000611dfb8284611dbe565b915081905092915050565b6000604082019050611e1b60008301856113c2565b8181036020830152611e2d8184611ca3565b90509392505050565b60008160601b9050919050565b6000611e4e82611e36565b9050919050565b6000611e6082611e43565b9050919050565b611e78611e73826113b0565b611e55565b82525050565b6000611e8a8285611dbe565b9150611e968284611e67565b6014820191508190509392505050565b6000606082019050611ebb60008301866113c2565b611ec860208301856113c2565b611ed560408301846116e8565b949350505050565b611ee681611adf565b8114611ef157600080fd5b50565b600081519050611f0381611edd565b92915050565b600060208284031215611f1f57611f1e6113f6565b5b6000611f2d84828501611ef4565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083356001602003843603038112611f6257611f61611f36565b5b80840192508235915067ffffffffffffffff821115611f8457611f83611f3b565b5b602083019250600182023603831315611fa057611f9f611f40565b5b509250929050565b600081519050611fb78161158f565b92915050565b600081519050611fcc81611736565b92915050565b60008060408385031215611fe957611fe86113f6565b5b6000611ff785828601611fa8565b925050602061200885828601611fbd565b9150509250929050565b7f7a72633230206973206e6f742067617320746f6b656e00000000000000000000600082015250565b600061204860168361195e565b915061205382612012565b602082019050919050565b600060208201905081810360008301526120778161203b565b9050919050565b7f66656520616d6f756e7420697320686967686572207468616e2074686520616d60008201527f6f756e7400000000000000000000000000000000000000000000000000000000602082015250565b60006120da60248361195e565b91506120e58261207e565b604082019050919050565b60006020820190508181036000830152612109816120cd565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061214a826116de565b9150612155836116de565b925082820390508181111561216d5761216c612110565b5b92915050565b600060408201905061218860008301856113c2565b61219560208301846116e8565b9392505050565b600060808201905081810360008301526121b681876118cb565b90506121c560208301866116e8565b6121d260408301856113c2565b81810360608301526121e48184611ca3565b905095945050505050565b60006121fb8385611d60565b93506122088385846114c7565b82840190509392505050565b60006122218284866121ef565b91508190509392505050565b7f7265766572740000000000000000000000000000000000000000000000000000600082015250565b6000612263600683611db3565b915061226e8261222d565b600682019050919050565b600061228482612256565b9150819050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006122c8826116de565b91506122d3836116de565b9250826122e3576122e261228e565b5b828204905092915050565b7f7769746864726177000000000000000000000000000000000000000000000000600082015250565b6000612324600883611db3565b915061232f826122ee565b600882019050919050565b600061234582612317565b915081905091905056fea2646970667358221220cc1d392f0803f3c30b8da3699bebbbdf5e1711d9c77c2bd74f9a96c12336d8f564736f6c634300081a0033" } diff --git a/pkg/contracts/testdappv2/TestDAppV2.sol b/pkg/contracts/testdappv2/TestDAppV2.sol index a6404db1e8..40652c41e3 100644 --- a/pkg/contracts/testdappv2/TestDAppV2.sol +++ b/pkg/contracts/testdappv2/TestDAppV2.sol @@ -9,6 +9,23 @@ struct RevertOptions { uint256 onRevertGasLimit; } +interface IGatewayZEVM { + function withdraw( + bytes memory receiver, + uint256 amount, + address zrc20, + RevertOptions calldata revertOptions + ) external; + + function call( + bytes memory receiver, + address zrc20, + bytes calldata message, + uint256 gasLimit, + RevertOptions calldata revertOptions + ) external; +} + interface IGatewayEVM { function deposit(address receiver, RevertOptions calldata revertOptions) external payable; function depositAndCall( @@ -21,6 +38,11 @@ interface IGatewayEVM { function call(address receiver, bytes calldata payload, RevertOptions calldata revertOptions) external; } +interface IZRC20 { + function approve(address spender, uint256 amount) external returns (bool); + function withdrawGasFee() external view returns (address, uint256); +} + interface IERC20 { function transferFrom(address sender, address recipient, uint256 amount) external returns (bool); } @@ -150,6 +172,24 @@ contract TestDAppV2 { // we do it specifically for ZetaChain to test the outbound processing workflow if (isZetaChain) { consumeGas(); + + // withdraw funds to the sender on connected chain + if (isWithdrawMessage(string(revertContext.revertMessage))) { + (address feeToken, uint256 feeAmount) = IZRC20(revertContext.asset).withdrawGasFee(); + require(feeToken == revertContext.asset, "zrc20 is not gas token"); + require(feeAmount <= revertContext.amount, "fee amount is higher than the amount"); + uint256 withdrawAmount = revertContext.amount - feeAmount; + + IZRC20(revertContext.asset).approve(msg.sender, revertContext.amount); + + // caller is the gateway + IGatewayZEVM(msg.sender).withdraw( + abi.encode(revertContext.sender), + withdrawAmount, + revertContext.asset, + RevertOptions(address(0), false, address(0), "", 0) + ); + } } setCalledWithMessage(string(revertContext.revertMessage)); @@ -202,5 +242,9 @@ contract TestDAppV2 { delete storageArray; } + function isWithdrawMessage(string memory message) internal pure returns (bool) { + return keccak256(abi.encodePacked(message)) == keccak256(abi.encodePacked("withdraw")); + } + receive() external payable {} } \ No newline at end of file From 8d506145b6f4d7b190c6c3b300c5f05e1030676f Mon Sep 17 00:00:00 2001 From: lumtis Date: Mon, 13 Jan 2025 16:34:57 +0100 Subject: [PATCH 02/11] add revert and withdraw test --- cmd/zetae2e/local/evm.go | 1 + e2e/e2etests/e2etests.go | 71 +++++++++++-------- ..._withdraw_and_call_revert_with_withdraw.go | 53 ++++++++++++++ 3 files changed, 94 insertions(+), 31 deletions(-) create mode 100644 e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go diff --git a/cmd/zetae2e/local/evm.go b/cmd/zetae2e/local/evm.go index b7fc1d9b71..bcb88041e8 100644 --- a/cmd/zetae2e/local/evm.go +++ b/cmd/zetae2e/local/evm.go @@ -59,6 +59,7 @@ func startEVMTests(eg *errgroup.Group, conf config.Config, deployerRunner *runne e2etests.TestETHDepositAndCallRevertWithCallName, e2etests.TestETHWithdrawAndCallRevertName, e2etests.TestETHWithdrawAndCallRevertWithCallName, + e2etests.TestETHWithdrawAndCallRevertWithWithdrawName, e2etests.TestDepositAndCallOutOfGasName, ), ) diff --git a/e2e/e2etests/e2etests.go b/e2e/e2etests/e2etests.go index 884573d2fa..031062f3fd 100644 --- a/e2e/e2etests/e2etests.go +++ b/e2e/e2etests/e2etests.go @@ -11,37 +11,38 @@ const ( /* EVM chain tests */ - TestETHDepositName = "eth_deposit" - TestETHDepositAndCallName = "eth_deposit_and_call" - TestETHDepositAndCallNoMessageName = "eth_deposit_and_call_no_message" - TestETHDepositAndCallRevertName = "eth_deposit_and_call_revert" - TestETHDepositAndCallRevertWithCallName = "eth_deposit_and_call_revert_with_call" - TestETHWithdrawName = "eth_withdraw" - TestETHWithdrawAndArbitraryCallName = "eth_withdraw_and_arbitrary_call" - TestETHWithdrawAndCallName = "eth_withdraw_and_call" - TestETHWithdrawAndCallNoMessageName = "eth_withdraw_and_call_no_message" - TestETHWithdrawAndCallThroughContractName = "eth_withdraw_and_call_through_contract" - TestETHWithdrawAndCallRevertName = "eth_withdraw_and_call_revert" - TestETHWithdrawAndCallRevertWithCallName = "eth_withdraw_and_call_revert_with_call" - TestDepositAndCallOutOfGasName = "deposit_and_call_out_of_gas" - TestERC20DepositName = "erc20_deposit" - TestERC20DepositAndCallName = "erc20_deposit_and_call" - TestERC20DepositAndCallNoMessageName = "erc20_deposit_and_call_no_message" - TestERC20DepositAndCallRevertName = "erc20_deposit_and_call_revert" - TestERC20DepositAndCallRevertWithCallName = "erc20_deposit_and_call_revert_with_call" - TestERC20WithdrawName = "erc20_withdraw" - TestERC20WithdrawAndArbitraryCallName = "erc20_withdraw_and_arbitrary_call" - TestERC20WithdrawAndCallName = "erc20_withdraw_and_call" - TestERC20WithdrawAndCallNoMessageName = "erc20_withdraw_and_call_no_message" - TestERC20WithdrawAndCallRevertName = "erc20_withdraw_and_call_revert" - TestERC20WithdrawAndCallRevertWithCallName = "erc20_withdraw_and_call_revert_with_call" - TestZEVMToEVMArbitraryCallName = "zevm_to_evm_arbitrary_call" - TestZEVMToEVMCallName = "zevm_to_evm_call" - TestZEVMToEVMCallThroughContractName = "zevm_to_evm_call_through_contract" - TestEVMToZEVMCallName = "evm_to_zevm_call" - TestDepositAndCallSwapName = "deposit_and_call_swap" - TestEtherWithdrawRestrictedName = "eth_withdraw_restricted" - TestERC20DepositRestrictedName = "erc20_deposit_restricted" // #nosec G101: Potential hardcoded credentials (gosec), not a credential + TestETHDepositName = "eth_deposit" + TestETHDepositAndCallName = "eth_deposit_and_call" + TestETHDepositAndCallNoMessageName = "eth_deposit_and_call_no_message" + TestETHDepositAndCallRevertName = "eth_deposit_and_call_revert" + TestETHDepositAndCallRevertWithCallName = "eth_deposit_and_call_revert_with_call" + TestETHWithdrawName = "eth_withdraw" + TestETHWithdrawAndArbitraryCallName = "eth_withdraw_and_arbitrary_call" + TestETHWithdrawAndCallName = "eth_withdraw_and_call" + TestETHWithdrawAndCallNoMessageName = "eth_withdraw_and_call_no_message" + TestETHWithdrawAndCallThroughContractName = "eth_withdraw_and_call_through_contract" + TestETHWithdrawAndCallRevertName = "eth_withdraw_and_call_revert" + TestETHWithdrawAndCallRevertWithCallName = "eth_withdraw_and_call_revert_with_call" + TestETHWithdrawAndCallRevertWithWithdrawName = "eth_withdraw_and_call_revert_with_withdraw" + TestDepositAndCallOutOfGasName = "deposit_and_call_out_of_gas" + TestERC20DepositName = "erc20_deposit" + TestERC20DepositAndCallName = "erc20_deposit_and_call" + TestERC20DepositAndCallNoMessageName = "erc20_deposit_and_call_no_message" + TestERC20DepositAndCallRevertName = "erc20_deposit_and_call_revert" + TestERC20DepositAndCallRevertWithCallName = "erc20_deposit_and_call_revert_with_call" + TestERC20WithdrawName = "erc20_withdraw" + TestERC20WithdrawAndArbitraryCallName = "erc20_withdraw_and_arbitrary_call" + TestERC20WithdrawAndCallName = "erc20_withdraw_and_call" + TestERC20WithdrawAndCallNoMessageName = "erc20_withdraw_and_call_no_message" + TestERC20WithdrawAndCallRevertName = "erc20_withdraw_and_call_revert" + TestERC20WithdrawAndCallRevertWithCallName = "erc20_withdraw_and_call_revert_with_call" + TestZEVMToEVMArbitraryCallName = "zevm_to_evm_arbitrary_call" + TestZEVMToEVMCallName = "zevm_to_evm_call" + TestZEVMToEVMCallThroughContractName = "zevm_to_evm_call_through_contract" + TestEVMToZEVMCallName = "evm_to_zevm_call" + TestDepositAndCallSwapName = "deposit_and_call_swap" + TestEtherWithdrawRestrictedName = "eth_withdraw_restricted" + TestERC20DepositRestrictedName = "erc20_deposit_restricted" // #nosec G101: Potential hardcoded credentials (gosec), not a credential /* * Solana tests @@ -295,6 +296,14 @@ var AllE2ETests = []runner.E2ETest{ }, TestETHWithdrawAndCallRevertWithCall, ), + runner.NewE2ETest( + TestETHWithdrawAndCallRevertWithWithdrawName, + "withdraw Ether from ZEVM and call a contract that reverts with a onRevert call that triggers a withdraw", + []runner.ArgDefinition{ + {Description: "amount in wei", DefaultValue: "10000000000000000"}, + }, + TestETHWithdrawAndCallRevertWithWithdraw, + ), runner.NewE2ETest( TestDepositAndCallOutOfGasName, "deposit Ether into ZEVM and call a contract that runs out of gas", diff --git a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go new file mode 100644 index 0000000000..1e4f48f3d8 --- /dev/null +++ b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go @@ -0,0 +1,53 @@ +package e2etests + +import ( + "math/big" + + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/stretchr/testify/require" + "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" + + "github.com/zeta-chain/node/e2e/runner" + "github.com/zeta-chain/node/e2e/utils" + crosschaintypes "github.com/zeta-chain/node/x/crosschain/types" +) + +func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string) { + require.Len(r, args, 1) + + amount := utils.ParseBigInt(r, args[0]) + + payload := randomPayload(r) + + r.AssertTestDAppZEVMCalled(false, payload, amount) + + r.ApproveETHZRC20(r.GatewayZEVMAddr) + + // perform the withdraw + tx := r.ETHWithdrawAndArbitraryCall( + r.TestDAppV2EVMAddr, + amount, + r.EncodeGasCall("revert"), + gatewayzevm.RevertOptions{ + RevertAddress: r.TestDAppV2ZEVMAddr, + CallOnRevert: true, + RevertMessage: []byte("withdraw"), // call withdraw in the onRevert hook + OnRevertGasLimit: big.NewInt(0), + }, + ) + + // wait for the cctx to be mined + cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctx, "withdraw") + require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) + + r.AssertTestDAppZEVMCalled(true, payload, big.NewInt(0)) + + // check expected sender was used + senderForMsg, err := r.TestDAppV2ZEVM.SenderWithMessage( + &bind.CallOpts{}, + []byte(payload), + ) + require.NoError(r, err) + require.Equal(r, r.ZEVMAuth.From, senderForMsg) +} From c992cfd966839eeb3b7b86a3b8fb7b5bc5cb0222 Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 11:22:56 +0100 Subject: [PATCH 03/11] add tx response to revert deposit --- x/crosschain/types/expected_keepers.go | 2 +- x/fungible/keeper/v2_deposits.go | 22 +++++++++++----------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/x/crosschain/types/expected_keepers.go b/x/crosschain/types/expected_keepers.go index a738242a34..c949c19990 100644 --- a/x/crosschain/types/expected_keepers.go +++ b/x/crosschain/types/expected_keepers.go @@ -161,7 +161,7 @@ type FungibleKeeper interface { revertAddress ethcommon.Address, callOnRevert bool, revertMessage []byte, - ) error + ) (*evmtypes.MsgEthereumTxResponse, error) CallUniswapV2RouterSwapExactTokensForTokens( ctx sdk.Context, sender ethcommon.Address, diff --git a/x/fungible/keeper/v2_deposits.go b/x/fungible/keeper/v2_deposits.go index 16486dcbff..f13fb86aa7 100644 --- a/x/fungible/keeper/v2_deposits.go +++ b/x/fungible/keeper/v2_deposits.go @@ -59,7 +59,7 @@ func (k Keeper) ProcessV2RevertDeposit( revertAddress ethcommon.Address, callOnRevert bool, revertMessage []byte, -) error { +) (*evmtypes.MsgEthereumTxResponse, error) { // get the zrc20 contract zrc20Addr, _, err := k.getAndCheckZRC20( ctx, @@ -69,7 +69,7 @@ func (k Keeper) ProcessV2RevertDeposit( asset, ) if err != nil { - return err + return nil, err } switch coinType { @@ -77,18 +77,18 @@ func (k Keeper) ProcessV2RevertDeposit( if callOnRevert { // no asset, call simple revert - _, err := k.CallExecuteRevert(ctx, inboundSender, zrc20Addr, amount, revertAddress, revertMessage) - return err + res, err := k.CallExecuteRevert(ctx, inboundSender, zrc20Addr, amount, revertAddress, revertMessage) + return res, err } else { // no asset, no call, do nothing - return nil + return nil, nil } case coin.CoinType_Zeta: - return errors.New("ZETA asset is currently unsupported for revert with V2 protocol contracts") + return nil, errors.New("ZETA asset is currently unsupported for revert with V2 protocol contracts") case coin.CoinType_ERC20, coin.CoinType_Gas: if callOnRevert { // revert with a ZRC20 asset - _, err := k.CallDepositAndRevert( + res, err := k.CallDepositAndRevert( ctx, inboundSender, zrc20Addr, @@ -96,13 +96,13 @@ func (k Keeper) ProcessV2RevertDeposit( revertAddress, revertMessage, ) - return err + return res, err } else { // simply deposit back to the revert address - _, err := k.DepositZRC20(ctx, zrc20Addr, revertAddress, amount) - return err + res, err := k.DepositZRC20(ctx, zrc20Addr, revertAddress, amount) + return res, err } } - return fmt.Errorf("unsupported coin type for revert %s", coinType) + return nil, fmt.Errorf("unsupported coin type for revert %s", coinType) } From 9410dc081cf634c4850cb52a018e90c0957edfde Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 11:23:28 +0100 Subject: [PATCH 04/11] process withdraw --- .../cctx_orchestrator_validate_outbound.go | 46 +++++++++++++++++-- 1 file changed, 41 insertions(+), 5 deletions(-) diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index 173093c771..ade24e722e 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -11,11 +11,13 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" + evmtypes "github.com/zeta-chain/ethermint/x/evm/types" "github.com/zeta-chain/node/pkg/chains" "github.com/zeta-chain/node/pkg/coin" "github.com/zeta-chain/node/x/crosschain/types" fungiblekeeper "github.com/zeta-chain/node/x/fungible/keeper" + fungibletypes "github.com/zeta-chain/node/x/fungible/types" observertypes "github.com/zeta-chain/node/x/observer/types" ) @@ -352,21 +354,55 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT // update status cctx.SetPendingRevert("", "outbound failed") + // use a temporary context to not commit any state change in case of error + tmpCtx, commit := ctx.CacheContext() + // process the revert on ZEVM - if err := k.fungibleKeeper.ProcessV2RevertDeposit( - ctx, + to := ethcommon.HexToAddress(cctx.GetCurrentOutboundParam().Receiver) + evmTxResponse, err := k.fungibleKeeper.ProcessV2RevertDeposit( + tmpCtx, cctx.InboundParams.Sender, cctx.GetCurrentOutboundParam().Amount.BigInt(), chainID, cctx.InboundParams.CoinType, cctx.InboundParams.Asset, - ethcommon.HexToAddress(cctx.GetCurrentOutboundParam().Receiver), + to, cctx.RevertOptions.CallOnRevert, cctx.RevertOptions.RevertMessage, - ); err != nil { - return errors.Wrap(err, "failed ProcessV2RevertDeposit") + ) + if fungibletypes.IsContractReverted(evmTxResponse, err) { + // this is a contract revert, we commit the state to save the emitted logs related to revert + commit() + return errors.Wrap(err, "revert transaction reverted") + } else if err != nil { + // this should not happen and we don't commit the state to avoid inconsistent state + return errors.Wrap(err, "revert transaction couldn't be processed") } + // a withdrawal event in the logs could generate cctxs for outbound transactions. + if !evmTxResponse.Failed() { + logs := evmtypes.LogsToEthereum(evmTxResponse.Logs) + if len(logs) > 0 { + tmpCtx = tmpCtx.WithValue(InCCTXIndexKey, cctx.Index) + txOrigin := cctx.InboundParams.TxOrigin + if txOrigin == "" { + txOrigin = cctx.InboundParams.Sender + } + + // process logs to process cctx events initiated during the contract call + err = k.ProcessLogs(tmpCtx, logs, to, txOrigin) + if err != nil { + // this happens if the cctx events are not processed correctly with invalid withdrawals + // in this situation we want the CCTX to be reverted, we don't commit the state so the contract call is not persisted + // the contract call is considered as reverted + return errors.Wrap(types.ErrCannotProcessWithdrawal, err.Error()) + } + } + } + + // commit state change from the deposit and eventual cctx events + commit() + // tx is reverted cctx.SetReverted("", "outbound failed") From f4f689c8fb6802a7217926df21dc059e3f6557c1 Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 11:23:45 +0100 Subject: [PATCH 05/11] tests --- cmd/zetae2e/local/evm.go | 108 +++++++++--------- ..._withdraw_and_call_revert_with_withdraw.go | 24 ++-- testutil/keeper/mocks/crosschain/fungible.go | 22 +++- 3 files changed, 79 insertions(+), 75 deletions(-) diff --git a/cmd/zetae2e/local/evm.go b/cmd/zetae2e/local/evm.go index bcb88041e8..c726faedd3 100644 --- a/cmd/zetae2e/local/evm.go +++ b/cmd/zetae2e/local/evm.go @@ -14,36 +14,36 @@ import ( // startEVMTests starts EVM chains related tests in parallel func startEVMTests(eg *errgroup.Group, conf config.Config, deployerRunner *runner.E2ERunner, verbose bool) { - // Test happy paths for gas token workflow - eg.Go(evmTestRoutine(conf, "eth", conf.AdditionalAccounts.UserEther, color.FgHiGreen, deployerRunner, verbose, - e2etests.TestETHDepositName, - e2etests.TestETHDepositAndCallName, - e2etests.TestETHWithdrawName, - e2etests.TestETHWithdrawAndArbitraryCallName, - e2etests.TestETHWithdrawAndCallName, - e2etests.TestETHWithdrawAndCallThroughContractName, - e2etests.TestZEVMToEVMArbitraryCallName, - e2etests.TestZEVMToEVMCallName, - e2etests.TestZEVMToEVMCallThroughContractName, - e2etests.TestEVMToZEVMCallName, - e2etests.TestETHDepositAndCallNoMessageName, - e2etests.TestETHWithdrawAndCallNoMessageName, - e2etests.TestEtherWithdrawRestrictedName, - )) - - // Test happy paths for erc20 token workflow - eg.Go(evmTestRoutine(conf, "erc20", conf.AdditionalAccounts.UserERC20, color.FgHiBlue, deployerRunner, verbose, - e2etests.TestETHDepositName, // necessary to pay fees on ZEVM - e2etests.TestERC20DepositName, - e2etests.TestERC20DepositAndCallName, - e2etests.TestERC20WithdrawName, - e2etests.TestERC20WithdrawAndArbitraryCallName, - e2etests.TestERC20WithdrawAndCallName, - e2etests.TestERC20DepositAndCallNoMessageName, - e2etests.TestERC20WithdrawAndCallNoMessageName, - e2etests.TestDepositAndCallSwapName, - e2etests.TestERC20DepositRestrictedName, - )) + //// Test happy paths for gas token workflow + //eg.Go(evmTestRoutine(conf, "eth", conf.AdditionalAccounts.UserEther, color.FgHiGreen, deployerRunner, verbose, + // e2etests.TestETHDepositName, + // e2etests.TestETHDepositAndCallName, + // e2etests.TestETHWithdrawName, + // e2etests.TestETHWithdrawAndArbitraryCallName, + // e2etests.TestETHWithdrawAndCallName, + // e2etests.TestETHWithdrawAndCallThroughContractName, + // e2etests.TestZEVMToEVMArbitraryCallName, + // e2etests.TestZEVMToEVMCallName, + // e2etests.TestZEVMToEVMCallThroughContractName, + // e2etests.TestEVMToZEVMCallName, + // e2etests.TestETHDepositAndCallNoMessageName, + // e2etests.TestETHWithdrawAndCallNoMessageName, + // e2etests.TestEtherWithdrawRestrictedName, + //)) + // + //// Test happy paths for erc20 token workflow + //eg.Go(evmTestRoutine(conf, "erc20", conf.AdditionalAccounts.UserERC20, color.FgHiBlue, deployerRunner, verbose, + // e2etests.TestETHDepositName, // necessary to pay fees on ZEVM + // e2etests.TestERC20DepositName, + // e2etests.TestERC20DepositAndCallName, + // e2etests.TestERC20WithdrawName, + // e2etests.TestERC20WithdrawAndArbitraryCallName, + // e2etests.TestERC20WithdrawAndCallName, + // e2etests.TestERC20DepositAndCallNoMessageName, + // e2etests.TestERC20WithdrawAndCallNoMessageName, + // e2etests.TestDepositAndCallSwapName, + // e2etests.TestERC20DepositRestrictedName, + //)) // Test revert cases for gas token workflow eg.Go( @@ -55,34 +55,34 @@ func startEVMTests(eg *errgroup.Group, conf config.Config, deployerRunner *runne deployerRunner, verbose, e2etests.TestETHDepositName, // necessary to pay fees on ZEVM and withdraw - e2etests.TestETHDepositAndCallRevertName, - e2etests.TestETHDepositAndCallRevertWithCallName, - e2etests.TestETHWithdrawAndCallRevertName, - e2etests.TestETHWithdrawAndCallRevertWithCallName, + //e2etests.TestETHDepositAndCallRevertName, + //e2etests.TestETHDepositAndCallRevertWithCallName, + //e2etests.TestETHWithdrawAndCallRevertName, + //e2etests.TestETHWithdrawAndCallRevertWithCallName, e2etests.TestETHWithdrawAndCallRevertWithWithdrawName, - e2etests.TestDepositAndCallOutOfGasName, + //e2etests.TestDepositAndCallOutOfGasName, ), ) - // Test revert cases for erc20 token workflow - eg.Go( - evmTestRoutine( - conf, - "erc20-revert", - conf.AdditionalAccounts.UserERC20Revert, - color.FgHiRed, - deployerRunner, - verbose, - e2etests.TestETHDepositName, // necessary to pay fees on ZEVM - e2etests.TestERC20DepositName, // necessary to have assets to withdraw - e2etests.TestOperationAddLiquidityETHName, // liquidity with gas and ERC20 are necessary for reverts - e2etests.TestOperationAddLiquidityERC20Name, - e2etests.TestERC20DepositAndCallRevertName, - e2etests.TestERC20DepositAndCallRevertWithCallName, - e2etests.TestERC20WithdrawAndCallRevertName, - e2etests.TestERC20WithdrawAndCallRevertWithCallName, - ), - ) + //// Test revert cases for erc20 token workflow + //eg.Go( + // evmTestRoutine( + // conf, + // "erc20-revert", + // conf.AdditionalAccounts.UserERC20Revert, + // color.FgHiRed, + // deployerRunner, + // verbose, + // e2etests.TestETHDepositName, // necessary to pay fees on ZEVM + // e2etests.TestERC20DepositName, // necessary to have assets to withdraw + // e2etests.TestOperationAddLiquidityETHName, // liquidity with gas and ERC20 are necessary for reverts + // e2etests.TestOperationAddLiquidityERC20Name, + // e2etests.TestERC20DepositAndCallRevertName, + // e2etests.TestERC20DepositAndCallRevertWithCallName, + // e2etests.TestERC20WithdrawAndCallRevertName, + // e2etests.TestERC20WithdrawAndCallRevertWithCallName, + // ), + //) } // evmTestRoutine runs EVM chain related e2e tests diff --git a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go index 1e4f48f3d8..65815a55f9 100644 --- a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go @@ -3,7 +3,6 @@ package e2etests import ( "math/big" - "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/stretchr/testify/require" "github.com/zeta-chain/protocol-contracts/v2/pkg/gatewayzevm.sol" @@ -17,10 +16,6 @@ func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string amount := utils.ParseBigInt(r, args[0]) - payload := randomPayload(r) - - r.AssertTestDAppZEVMCalled(false, payload, amount) - r.ApproveETHZRC20(r.GatewayZEVMAddr) // perform the withdraw @@ -37,17 +32,14 @@ func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string ) // wait for the cctx to be mined - cctx := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) - r.Logger.CCTX(*cctx, "withdraw") - require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctx.CctxStatus.Status) + cctxRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, tx.Hash().Hex(), r.CctxClient, r.Logger, r.CctxTimeout) + r.Logger.CCTX(*cctxRevert, "withdraw") + require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctxRevert.CctxStatus.Status) - r.AssertTestDAppZEVMCalled(true, payload, big.NewInt(0)) + r.Logger.Print("cctxRevert") + r.Logger.Print(cctxRevert.String()) + //cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, cctxRevert, r.CctxClient, r.Logger, r.CctxTimeout) - // check expected sender was used - senderForMsg, err := r.TestDAppV2ZEVM.SenderWithMessage( - &bind.CallOpts{}, - []byte(payload), - ) - require.NoError(r, err) - require.Equal(r, r.ZEVMAuth.From, senderForMsg) + // check the cctx status + //utils.RequireCCTXStatus(r, cctxWithdrawFromRevert, crosschaintypes.CctxStatus_OutboundMined) } diff --git a/testutil/keeper/mocks/crosschain/fungible.go b/testutil/keeper/mocks/crosschain/fungible.go index 856e3e8313..9ad11dc606 100644 --- a/testutil/keeper/mocks/crosschain/fungible.go +++ b/testutil/keeper/mocks/crosschain/fungible.go @@ -419,21 +419,33 @@ func (_m *CrosschainFungibleKeeper) GetUniswapV2Router02Address(ctx types.Contex } // ProcessV2RevertDeposit provides a mock function with given fields: ctx, inboundSender, amount, chainID, coinType, asset, revertAddress, callOnRevert, revertMessage -func (_m *CrosschainFungibleKeeper) ProcessV2RevertDeposit(ctx types.Context, inboundSender string, amount *big.Int, chainID int64, coinType coin.CoinType, asset string, revertAddress common.Address, callOnRevert bool, revertMessage []byte) error { +func (_m *CrosschainFungibleKeeper) ProcessV2RevertDeposit(ctx types.Context, inboundSender string, amount *big.Int, chainID int64, coinType coin.CoinType, asset string, revertAddress common.Address, callOnRevert bool, revertMessage []byte) (*evmtypes.MsgEthereumTxResponse, error) { ret := _m.Called(ctx, inboundSender, amount, chainID, coinType, asset, revertAddress, callOnRevert, revertMessage) if len(ret) == 0 { panic("no return value specified for ProcessV2RevertDeposit") } - var r0 error - if rf, ok := ret.Get(0).(func(types.Context, string, *big.Int, int64, coin.CoinType, string, common.Address, bool, []byte) error); ok { + var r0 *evmtypes.MsgEthereumTxResponse + var r1 error + if rf, ok := ret.Get(0).(func(types.Context, string, *big.Int, int64, coin.CoinType, string, common.Address, bool, []byte) (*evmtypes.MsgEthereumTxResponse, error)); ok { + return rf(ctx, inboundSender, amount, chainID, coinType, asset, revertAddress, callOnRevert, revertMessage) + } + if rf, ok := ret.Get(0).(func(types.Context, string, *big.Int, int64, coin.CoinType, string, common.Address, bool, []byte) *evmtypes.MsgEthereumTxResponse); ok { r0 = rf(ctx, inboundSender, amount, chainID, coinType, asset, revertAddress, callOnRevert, revertMessage) } else { - r0 = ret.Error(0) + if ret.Get(0) != nil { + r0 = ret.Get(0).(*evmtypes.MsgEthereumTxResponse) + } } - return r0 + if rf, ok := ret.Get(1).(func(types.Context, string, *big.Int, int64, coin.CoinType, string, common.Address, bool, []byte) error); ok { + r1 = rf(ctx, inboundSender, amount, chainID, coinType, asset, revertAddress, callOnRevert, revertMessage) + } else { + r1 = ret.Error(1) + } + + return r0, r1 } // QueryGasLimit provides a mock function with given fields: ctx, contract From 3712422d068eb541a99736e7503a698594723578 Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 11:36:45 +0100 Subject: [PATCH 06/11] add withdraw and revert check in test --- .../test_eth_withdraw_and_call_revert_with_withdraw.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go index 65815a55f9..d43d8a6632 100644 --- a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go @@ -38,8 +38,8 @@ func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string r.Logger.Print("cctxRevert") r.Logger.Print(cctxRevert.String()) - //cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, cctxRevert, r.CctxClient, r.Logger, r.CctxTimeout) + cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, cctxRevert.Index, r.CctxClient, r.Logger, r.CctxTimeout) - // check the cctx status - //utils.RequireCCTXStatus(r, cctxWithdrawFromRevert, crosschaintypes.CctxStatus_OutboundMined) + //check the cctx status + utils.RequireCCTXStatus(r, cctxWithdrawFromRevert, crosschaintypes.CctxStatus_OutboundMined) } From 2118c6e4ab01b2bf95eabf73ced1c1d1e261354d Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 11:37:01 +0100 Subject: [PATCH 07/11] comment lint --- e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go index d43d8a6632..947cf290a6 100644 --- a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go @@ -40,6 +40,6 @@ func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string r.Logger.Print(cctxRevert.String()) cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, cctxRevert.Index, r.CctxClient, r.Logger, r.CctxTimeout) - //check the cctx status + // check the cctx status utils.RequireCCTXStatus(r, cctxWithdrawFromRevert, crosschaintypes.CctxStatus_OutboundMined) } From 75b0b9b954bf66b956cc2a39fcb1ee20d702528d Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 12:46:03 +0100 Subject: [PATCH 08/11] add tests back --- cmd/zetae2e/local/evm.go | 108 +++++++++--------- ..._withdraw_and_call_revert_with_withdraw.go | 10 +- 2 files changed, 61 insertions(+), 57 deletions(-) diff --git a/cmd/zetae2e/local/evm.go b/cmd/zetae2e/local/evm.go index c726faedd3..bcb88041e8 100644 --- a/cmd/zetae2e/local/evm.go +++ b/cmd/zetae2e/local/evm.go @@ -14,36 +14,36 @@ import ( // startEVMTests starts EVM chains related tests in parallel func startEVMTests(eg *errgroup.Group, conf config.Config, deployerRunner *runner.E2ERunner, verbose bool) { - //// Test happy paths for gas token workflow - //eg.Go(evmTestRoutine(conf, "eth", conf.AdditionalAccounts.UserEther, color.FgHiGreen, deployerRunner, verbose, - // e2etests.TestETHDepositName, - // e2etests.TestETHDepositAndCallName, - // e2etests.TestETHWithdrawName, - // e2etests.TestETHWithdrawAndArbitraryCallName, - // e2etests.TestETHWithdrawAndCallName, - // e2etests.TestETHWithdrawAndCallThroughContractName, - // e2etests.TestZEVMToEVMArbitraryCallName, - // e2etests.TestZEVMToEVMCallName, - // e2etests.TestZEVMToEVMCallThroughContractName, - // e2etests.TestEVMToZEVMCallName, - // e2etests.TestETHDepositAndCallNoMessageName, - // e2etests.TestETHWithdrawAndCallNoMessageName, - // e2etests.TestEtherWithdrawRestrictedName, - //)) - // - //// Test happy paths for erc20 token workflow - //eg.Go(evmTestRoutine(conf, "erc20", conf.AdditionalAccounts.UserERC20, color.FgHiBlue, deployerRunner, verbose, - // e2etests.TestETHDepositName, // necessary to pay fees on ZEVM - // e2etests.TestERC20DepositName, - // e2etests.TestERC20DepositAndCallName, - // e2etests.TestERC20WithdrawName, - // e2etests.TestERC20WithdrawAndArbitraryCallName, - // e2etests.TestERC20WithdrawAndCallName, - // e2etests.TestERC20DepositAndCallNoMessageName, - // e2etests.TestERC20WithdrawAndCallNoMessageName, - // e2etests.TestDepositAndCallSwapName, - // e2etests.TestERC20DepositRestrictedName, - //)) + // Test happy paths for gas token workflow + eg.Go(evmTestRoutine(conf, "eth", conf.AdditionalAccounts.UserEther, color.FgHiGreen, deployerRunner, verbose, + e2etests.TestETHDepositName, + e2etests.TestETHDepositAndCallName, + e2etests.TestETHWithdrawName, + e2etests.TestETHWithdrawAndArbitraryCallName, + e2etests.TestETHWithdrawAndCallName, + e2etests.TestETHWithdrawAndCallThroughContractName, + e2etests.TestZEVMToEVMArbitraryCallName, + e2etests.TestZEVMToEVMCallName, + e2etests.TestZEVMToEVMCallThroughContractName, + e2etests.TestEVMToZEVMCallName, + e2etests.TestETHDepositAndCallNoMessageName, + e2etests.TestETHWithdrawAndCallNoMessageName, + e2etests.TestEtherWithdrawRestrictedName, + )) + + // Test happy paths for erc20 token workflow + eg.Go(evmTestRoutine(conf, "erc20", conf.AdditionalAccounts.UserERC20, color.FgHiBlue, deployerRunner, verbose, + e2etests.TestETHDepositName, // necessary to pay fees on ZEVM + e2etests.TestERC20DepositName, + e2etests.TestERC20DepositAndCallName, + e2etests.TestERC20WithdrawName, + e2etests.TestERC20WithdrawAndArbitraryCallName, + e2etests.TestERC20WithdrawAndCallName, + e2etests.TestERC20DepositAndCallNoMessageName, + e2etests.TestERC20WithdrawAndCallNoMessageName, + e2etests.TestDepositAndCallSwapName, + e2etests.TestERC20DepositRestrictedName, + )) // Test revert cases for gas token workflow eg.Go( @@ -55,34 +55,34 @@ func startEVMTests(eg *errgroup.Group, conf config.Config, deployerRunner *runne deployerRunner, verbose, e2etests.TestETHDepositName, // necessary to pay fees on ZEVM and withdraw - //e2etests.TestETHDepositAndCallRevertName, - //e2etests.TestETHDepositAndCallRevertWithCallName, - //e2etests.TestETHWithdrawAndCallRevertName, - //e2etests.TestETHWithdrawAndCallRevertWithCallName, + e2etests.TestETHDepositAndCallRevertName, + e2etests.TestETHDepositAndCallRevertWithCallName, + e2etests.TestETHWithdrawAndCallRevertName, + e2etests.TestETHWithdrawAndCallRevertWithCallName, e2etests.TestETHWithdrawAndCallRevertWithWithdrawName, - //e2etests.TestDepositAndCallOutOfGasName, + e2etests.TestDepositAndCallOutOfGasName, ), ) - //// Test revert cases for erc20 token workflow - //eg.Go( - // evmTestRoutine( - // conf, - // "erc20-revert", - // conf.AdditionalAccounts.UserERC20Revert, - // color.FgHiRed, - // deployerRunner, - // verbose, - // e2etests.TestETHDepositName, // necessary to pay fees on ZEVM - // e2etests.TestERC20DepositName, // necessary to have assets to withdraw - // e2etests.TestOperationAddLiquidityETHName, // liquidity with gas and ERC20 are necessary for reverts - // e2etests.TestOperationAddLiquidityERC20Name, - // e2etests.TestERC20DepositAndCallRevertName, - // e2etests.TestERC20DepositAndCallRevertWithCallName, - // e2etests.TestERC20WithdrawAndCallRevertName, - // e2etests.TestERC20WithdrawAndCallRevertWithCallName, - // ), - //) + // Test revert cases for erc20 token workflow + eg.Go( + evmTestRoutine( + conf, + "erc20-revert", + conf.AdditionalAccounts.UserERC20Revert, + color.FgHiRed, + deployerRunner, + verbose, + e2etests.TestETHDepositName, // necessary to pay fees on ZEVM + e2etests.TestERC20DepositName, // necessary to have assets to withdraw + e2etests.TestOperationAddLiquidityETHName, // liquidity with gas and ERC20 are necessary for reverts + e2etests.TestOperationAddLiquidityERC20Name, + e2etests.TestERC20DepositAndCallRevertName, + e2etests.TestERC20DepositAndCallRevertWithCallName, + e2etests.TestERC20WithdrawAndCallRevertName, + e2etests.TestERC20WithdrawAndCallRevertWithCallName, + ), + ) } // evmTestRoutine runs EVM chain related e2e tests diff --git a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go index 947cf290a6..4ff54c4b9a 100644 --- a/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go +++ b/e2e/e2etests/test_eth_withdraw_and_call_revert_with_withdraw.go @@ -36,9 +36,13 @@ func TestETHWithdrawAndCallRevertWithWithdraw(r *runner.E2ERunner, args []string r.Logger.CCTX(*cctxRevert, "withdraw") require.Equal(r, crosschaintypes.CctxStatus_Reverted, cctxRevert.CctxStatus.Status) - r.Logger.Print("cctxRevert") - r.Logger.Print(cctxRevert.String()) - cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash(r.Ctx, cctxRevert.Index, r.CctxClient, r.Logger, r.CctxTimeout) + cctxWithdrawFromRevert := utils.WaitCctxMinedByInboundHash( + r.Ctx, + cctxRevert.Index, + r.CctxClient, + r.Logger, + r.CctxTimeout, + ) // check the cctx status utils.RequireCCTXStatus(r, cctxWithdrawFromRevert, crosschaintypes.CctxStatus_OutboundMined) From 6ef97436d4df3b1e1b92fd4406ef8bea2182c717 Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 12:48:43 +0100 Subject: [PATCH 09/11] update changelog --- changelog.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/changelog.md b/changelog.md index 1128fda716..eaa112c6c5 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,11 @@ # CHANGELOG +## Unreleased + +### Fixes + +* [3348](https://github.com/zeta-chain/node/pull/3348) - add support to perform withdraws in ZetaChain `onRevert` call + ## v25.0.0 ### Features From aae2622300ee8f15695df2816285374e8084323d Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 18:16:28 +0100 Subject: [PATCH 10/11] add unit tests --- testutil/keeper/crosschain.go | 29 +++ .../cctx_orchestrator_validate_outbound.go | 2 +- ...ctx_orchestrator_validate_outbound_test.go | 220 +++++++++++++++++- 3 files changed, 245 insertions(+), 6 deletions(-) diff --git a/testutil/keeper/crosschain.go b/testutil/keeper/crosschain.go index d0f7d0220c..4941cb92e3 100644 --- a/testutil/keeper/crosschain.go +++ b/testutil/keeper/crosschain.go @@ -303,6 +303,35 @@ func MockFailedGetSupportedChainFromChainID(m *crosschainmocks.CrosschainObserve Return(chains.Chain{}, false).Once() } +func MockProcessV2RevertDeposit( + m *crosschainmocks.CrosschainFungibleKeeper, + retEVMTxResponse *evmtypes.MsgEthereumTxResponse, + retErr error, +) { + // ctx types.Context + // inboundSender string + // amount *big.Int + // chainID int64 + // coinType coin.CoinType + // asset string + // revertAddress common.Address + // callOnRevert bool + // revertMessage []byte + m.On( + "ProcessV2RevertDeposit", + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + mock.Anything, + ). + Return(retEVMTxResponse, retErr).Once() +} + func MockGetRevertGasLimitForERC20( m *crosschainmocks.CrosschainFungibleKeeper, asset string, diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index ade24e722e..d0d2ac6ee6 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -419,5 +419,5 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed cctx.SetAbort("aborted while processing failed outbound", "outbound and revert failed") } - return nil + return fmt.Errorf("unexpected cctx status %s", cctx.CctxStatus.Status) } diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go index 501848b3a0..5878976f20 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound_test.go @@ -2,10 +2,13 @@ package keeper_test import ( "encoding/base64" + "errors" + "github.com/ethereum/go-ethereum/core/vm" + evmtypes "github.com/zeta-chain/ethermint/x/evm/types" "math/big" "testing" - "cosmossdk.io/errors" + cosmoserror "cosmossdk.io/errors" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -26,32 +29,239 @@ func TestKeeper_ValidateSuccessfulOutbound(t *testing.T) { cctx := sample.CrossChainTx(t, "test") // transition to reverted if pending revert cctx.CctxStatus.Status = types.CctxStatus_PendingRevert - k.ValidateOutboundObservers( + err := k.ValidateOutboundObservers( ctx, cctx, observertypes.BallotStatus_BallotFinalized_SuccessObservation, sample.String(), ) + require.NoError(t, err) require.Equal(t, cctx.CctxStatus.Status, types.CctxStatus_Reverted) + // transition to outbound mined if pending outbound cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound - k.ValidateOutboundObservers( + err = k.ValidateOutboundObservers( ctx, cctx, observertypes.BallotStatus_BallotFinalized_SuccessObservation, sample.String(), ) + require.NoError(t, err) require.Equal(t, cctx.CctxStatus.Status, types.CctxStatus_OutboundMined) + // do nothing if it's in any other state - k.ValidateOutboundObservers( + err = k.ValidateOutboundObservers( ctx, cctx, observertypes.BallotStatus_BallotFinalized_SuccessObservation, sample.String(), ) + require.NoError(t, err) require.Equal(t, cctx.CctxStatus.Status, types.CctxStatus_OutboundMined) } +func TestKeeper_ValidateFailedOutboundV2(t *testing.T) { + t.Run("fail if can't fetch ZetaChain chain ID", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + + ctx = ctx.WithChainID("invalid") + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "failed to get ZetaChain chainID") + }) + + t.Run("fail if CCTX source chain is not ZetaChain", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.InboundParams.SenderChainId = chains.Ethereum.ChainId + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "sender chain for withdraw cctx is not ZetaChain") + }) + + t.Run("fail if fail to add revert outbound", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeper(t) + cctx := sample.CrossChainTxV2(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId + // fail to add revert outbound if it already exists + cctx.OutboundParams = []*types.OutboundParams{ + sample.OutboundParams(sample.Rand()), + sample.OutboundParams(sample.Rand()), + } + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "failed AddRevertOutbound") + }) + + t.Run("fail if the revert call get reverted", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ + UseFungibleMock: true, + }) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId + fungibleMock := keepertest.GetCrosschainFungibleMock(t, k) + + cctx.OutboundParams = []*types.OutboundParams{sample.OutboundParams(sample.Rand())} + + revertErr := vm.ErrExecutionReverted + keepertest.MockProcessV2RevertDeposit(fungibleMock, nil, revertErr) + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "revert transaction reverted") + }) + + t.Run("fail if the revert call can't be processed", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ + UseFungibleMock: true, + }) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId + fungibleMock := keepertest.GetCrosschainFungibleMock(t, k) + + cctx.OutboundParams = []*types.OutboundParams{sample.OutboundParams(sample.Rand())} + + keepertest.MockProcessV2RevertDeposit(fungibleMock, nil, errors.New("error that is not onRevert reverts")) + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "revert transaction couldn't be processed") + }) + + t.Run("process failed outbound with a revert", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ + UseFungibleMock: true, + }) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingOutbound + cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId + fungibleMock := keepertest.GetCrosschainFungibleMock(t, k) + + cctx.OutboundParams = []*types.OutboundParams{sample.OutboundParams(sample.Rand())} + + keepertest.MockProcessV2RevertDeposit(fungibleMock, &evmtypes.MsgEthereumTxResponse{}, nil) + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.NoError(t, err) + require.Len(t, cctx.OutboundParams, 2) + require.EqualValues(t, types.CctxStatus_Reverted, cctx.CctxStatus.Status) + }) + + t.Run("process aborting the cctx if is pending revert", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ + UseFungibleMock: true, + }) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_PendingRevert + cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.NoError(t, err) + require.EqualValues(t, types.CctxStatus_Aborted, cctx.CctxStatus.Status) + }) + + t.Run("fail if cctx status is invalid", func(t *testing.T) { + // arrange + k, ctx, _, _ := keepertest.CrosschainKeeperWithMocks(t, keepertest.CrosschainMockOptions{ + UseFungibleMock: true, + }) + cctx := sample.CrossChainTx(t, "test") + cctx.ProtocolContractVersion = types.ProtocolContractVersion_V2 + cctx.CctxStatus.Status = types.CctxStatus_OutboundMined + + // act + err := k.ValidateOutboundObservers( + ctx, + cctx, + observertypes.BallotStatus_BallotFinalized_FailureObservation, + sample.String(), + ) + + // assert + require.Error(t, err) + require.Contains(t, err.Error(), "unexpected cctx status") + }) +} + func TestKeeper_ValidateFailedOutbound(t *testing.T) { t.Run("successfully validates failed outbound set to aborted for type cmd", func(t *testing.T) { k, ctx, _, _ := keepertest.CrosschainKeeper(t) @@ -165,7 +375,7 @@ func TestKeeper_ValidateFailedOutbound(t *testing.T) { }) fungibleMock := keepertest.GetCrosschainFungibleMock(t, k) receiver := sample.EthAddress() - errorFailedZETARevertAndCallContract := errors.New("test", 999, "failed ZETARevertAndCallContract") + errorFailedZETARevertAndCallContract := cosmoserror.New("test", 999, "failed ZETARevertAndCallContract") cctx := GetERC20Cctx(t, receiver, chains.Goerli, "", big.NewInt(42)) cctx.InboundParams.CoinType = coin.CoinType_Zeta cctx.InboundParams.SenderChainId = chains.ZetaChainMainnet.ChainId From d9ab6f42c4cefe43beda3db6f752df9e917ce2d3 Mon Sep 17 00:00:00 2001 From: lumtis Date: Tue, 14 Jan 2025 18:39:25 +0100 Subject: [PATCH 11/11] fix test --- x/crosschain/keeper/cctx_orchestrator_validate_outbound.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go index d0d2ac6ee6..d34781ba61 100644 --- a/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go +++ b/x/crosschain/keeper/cctx_orchestrator_validate_outbound.go @@ -418,6 +418,9 @@ func (k Keeper) processFailedOutboundV2(ctx sdk.Context, cctx *types.CrossChainT case types.CctxStatus_PendingRevert: cctx.GetCurrentOutboundParam().TxFinalizationStatus = types.TxFinalizationStatus_Executed cctx.SetAbort("aborted while processing failed outbound", "outbound and revert failed") + default: + return fmt.Errorf("unexpected cctx status %s", cctx.CctxStatus.Status) } - return fmt.Errorf("unexpected cctx status %s", cctx.CctxStatus.Status) + + return nil }