From c0b82f9e17b2e068b3c40583be49992473687240 Mon Sep 17 00:00:00 2001 From: Zodomo Date: Tue, 10 Dec 2024 19:39:29 -0500 Subject: [PATCH] added more context about state updates --- contracts/bindings/solveinbox.go | 93 +++++++++++-- contracts/bindings/solveoutbox.go | 2 +- contracts/solve/.gas-snapshot | 60 ++++----- contracts/solve/src/Solve.sol | 7 + contracts/solve/src/SolveInbox.sol | 103 ++++++++++++--- contracts/solve/src/SolveOutbox.sol | 24 +++- .../solve/src/interfaces/ISolveInbox.sol | 10 ++ contracts/solve/test/Inbox_accept.t.sol | 45 +++++++ contracts/solve/test/Inbox_cancel.t.sol | 125 ++++++++++++++++++ contracts/solve/test/Inbox_claim.t.sol | 33 +++++ .../solve/test/Inbox_markFulfilled.t.sol | 11 ++ contracts/solve/test/Inbox_reject.t.sol | 61 +++++++++ contracts/solve/test/Inbox_request.t.sol | 33 +++++ 13 files changed, 546 insertions(+), 61 deletions(-) diff --git a/contracts/bindings/solveinbox.go b/contracts/bindings/solveinbox.go index f86c22dff..2ca30f3f5 100644 --- a/contracts/bindings/solveinbox.go +++ b/contracts/bindings/solveinbox.go @@ -46,13 +46,20 @@ type SolveDeposit struct { // SolveRequest is an auto generated low-level Go binding around an user-defined struct. type SolveRequest struct { - Id [32]byte - UpdatedAt *big.Int - Status uint8 - From common.Address - AcceptedBy common.Address - Call SolveCall - Deposits []SolveDeposit + Id [32]byte + UpdatedAt *big.Int + Status uint8 + From common.Address + AcceptedBy common.Address + Call SolveCall + Deposits []SolveDeposit + UpdateHistory []SolveStatusUpdate +} + +// SolveStatusUpdate is an auto generated low-level Go binding around an user-defined struct. +type SolveStatusUpdate struct { + Status uint8 + Timestamp *big.Int } // SolveTokenDeposit is an auto generated low-level Go binding around an user-defined struct. @@ -63,8 +70,8 @@ type SolveTokenDeposit struct { // SolveInboxMetaData contains all meta data concerning the SolveInbox contract. var SolveInboxMetaData = &bind.MetaData{ - ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"accept\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancel\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"claim\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeOwnershipHandover\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deployedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequest\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structSolve.Request\",\"components\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"updatedAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"acceptedBy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"grantRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"hasAllRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasAnyRole\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"solver_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"omni_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"outbox_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"markFulfilled\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"callHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"result\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownershipHandoverExpiresAt\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"result\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"reject\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reason\",\"type\":\"uint8\",\"internalType\":\"enumSolve.RejectReason\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceRoles\",\"inputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"request\",\"inputs\":[{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.TokenDeposit[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"requestOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"revokeRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"rolesOf\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Accepted\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Claimed\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Fulfilled\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"creditedTo\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverCanceled\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverRequested\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Rejected\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"reason\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumSolve.RejectReason\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Requested\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"call\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Reverted\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RolesUpdated\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyInitialized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDeposit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRecipient\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewOwnerIsZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoDeposits\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoHandoverRequest\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotAccepted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotFulfilled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotOutbox\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotPending\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotPendingOrRejected\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Reentrancy\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongCallHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongSourceChain\",\"inputs\":[]}]", - Bin: "0x60a06040523480156200001157600080fd5b504661a4b1141580156200002857504662066eee14155b15620000385743608052620000a2565b60646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000078573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009e919062000116565b6080525b620000ac620000b2565b62000130565b63409feecd1980546001811615620000d25763f92ee8a96000526004601cfd5b8160c01c808260011c1462000111578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012957600080fd5b5051919050565b6080516121746200014c60003960006103b001526121746000f3fe60806040526004361061014b5760003560e01c80638da5cb5b116100b6578063eae4c19f1161006f578063eae4c19f1461039e578063f04e283e146103d2578063f2fde38b146103e5578063f8c8765e146103f8578063fb1e61ca14610418578063fee81cf41461044557600080fd5b80638da5cb5b146102f257806396c144f01461030b578063c4d252f51461032b578063db3ea5531461034b578063e17771c81461036b578063e4725ba11461037e57600080fd5b806339acf9f11161010857806339acf9f11461022d5780634a4ee7b114610265578063514e62fc1461027857806354d1f13d146102af578063715018a6146102b757806374eeb847146102bf57600080fd5b8063183a4f6e146101505780631c10893f146101655780631cd64df41461017857806325692962146101c45780632de94807146101cc578063337ffe201461020d575b600080fd5b61016361015e3660046118ec565b610478565b005b61016361017336600461191a565b610485565b34801561018457600080fd5b506101af61019336600461191a565b638b78c6d8600c90815260009290925260209091205481161490565b60405190151581526020015b60405180910390f35b61016361049b565b3480156101d857600080fd5b506101ff6101e7366004611946565b638b78c6d8600c908152600091909152602090205490565b6040519081526020016101bb565b34801561021957600080fd5b5061016361022836600461196a565b6104ea565b34801561023957600080fd5b5060005461024d906001600160a01b031681565b6040516001600160a01b0390911681526020016101bb565b61016361027336600461191a565b610726565b34801561028457600080fd5b506101af61029336600461191a565b638b78c6d8600c90815260009290925260209091205416151590565b610163610738565b610163610774565b3480156102cb57600080fd5b506000546102e090600160a01b900460ff1681565b60405160ff90911681526020016101bb565b3480156102fe57600080fd5b50638b78c6d8195461024d565b34801561031757600080fd5b5061016361032636600461198c565b610788565b34801561033757600080fd5b506101636103463660046118ec565b61093e565b34801561035757600080fd5b506101636103663660046119bc565b610b07565b6101ff6103793660046119e5565b610bff565b34801561038a57600080fd5b506101636103993660046118ec565b610d73565b3480156103aa57600080fd5b506101ff7f000000000000000000000000000000000000000000000000000000000000000081565b6101636103e0366004611946565b610e6d565b6101636103f3366004611946565b610eaa565b34801561040457600080fd5b50610163610413366004611a86565b610ed1565b34801561042457600080fd5b506104386104333660046118ec565b610f7d565b6040516101bb9190611bd7565b34801561045157600080fd5b506101ff610460366004611946565b63389a75e1600c908152600091909152602090205490565b610482338261117f565b50565b61048d61118b565b61049782826111a6565b5050565b60006202a3006001600160401b03164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b60005460408051631799380760e11b815281516001600160a01b0390931692632f32700e926004808401939192918290030181865afa158015610531573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105559190611cba565b8051600180546020909301516001600160a01b0316600160401b026001600160e01b03199093166001600160401b039092169190911791909117905568929eee149b4bd21268543090036105b15763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060026001820154600160281b900460ff1660068111156105ed576105ed611ae2565b1461060b5760405163029d79a560e41b815260040160405180910390fd5b600354600154600160401b90046001600160a01b039081169116146106435760405163bda8fc9560e01b815260040160405180910390fd5b60038101546001546001600160401b0390811691161461067657604051633687f39960e21b815260040160405180910390fd5b6106848346836003016111b2565b82146106a357604051631c6060ab60e11b815260040160405180910390fd5b6001810180546505000000000065ffffffffffff199091164264ffffffffff161717905560028101546040516001600160a01b0390911690839085907f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89190600090a450503868929eee149b4bd212685550600180546001600160e01b0319169055565b61072e61118b565b610497828261117f565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b61077c61118b565b61078660006111e8565b565b3068929eee149b4bd2126854036107a75763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060056001820154600160281b900460ff1660068111156107e3576107e3611ae2565b14610801576040516303de361f60e11b815260040160405180910390fd5b60028101546001600160a01b0316331461082d576040516282b42960e81b815260040160405180910390fd5b6001810180546506000000000065ffffffffffff199091164264ffffffffff1617179055600681018054604080516020808402820181019092528281526108de938693919290919060009084015b828210156108d55760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b03168385015260019081015491830191909152908352909201910161087b565b50505050611226565b816001600160a01b0316336001600160a01b0316847f1291cec4ea55732527f1ae8ff3e53def0dbe1feb99c094983449e59cdce4674b846006016040516109259190611d71565b60405180910390a4503868929eee149b4bd21268555050565b3068929eee149b4bd21268540361095d5763ab143c066000526004601cfd5b3068929eee149b4bd21268556000818152600460205260409020600180820154600160281b900460ff16600681111561099857610998611ae2565b141580156109c6575060036001820154600160281b900460ff1660068111156109c3576109c3611ae2565b14155b156109e457604051631fa4148760e21b815260040160405180910390fd5b6001810154600160301b90046001600160a01b03163314610a17576040516282b42960e81b815260040160405180910390fd5b6001810180546504000000000065ffffffffffff199091164264ffffffffff1617179081905560068201805460408051602080840282018101909252828152610acc94600160301b90046001600160a01b03169390929091600090840182156108d55760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b03168385015260019081015491830191909152908352909201910161087b565b60405182907fb66b13449e4bb2c30749a37f3081f1988fcee5ff5d98ce740b354d4e2d94409590600090a2503868929eee149b4bd212685550565b6001610b1281611378565b3068929eee149b4bd212685403610b315763ab143c066000526004601cfd5b3068929eee149b4bd21268556000838152600460205260409020600180820154600160281b900460ff166006811115610b6c57610b6c611ae2565b14610b8a57604051633ee3282d60e11b815260040160405180910390fd5b6001810180546503000000000065ffffffffffff199091164264ffffffffff1617179055826003811115610bc057610bc0611ae2565b604051339086907f21f84ee3a6e9bc7c10f855f8c9829e22c613861cef10add09eccdbc88df9f59f90600090a4503868929eee149b4bd2126855505050565b60003068929eee149b4bd212685403610c205763ab143c066000526004601cfd5b3068929eee149b4bd21268556000610c3e6040860160208701611946565b6001600160a01b031603610c655760405163574b16a760e11b815260040160405180910390fd5b610c726020850185611d84565b6001600160401b0316600003610c9b5760405163574b16a760e11b815260040160405180910390fd5b610ca86060850185611da1565b9050600003610cca5760405163574b16a760e11b815260040160405180910390fd5b81158015610cd6575034155b15610cf457604051630558800760e21b815260040160405180910390fd5b6000610d023386868661139e565b60018101548154604051929350600160301b9091046001600160a01b0316917f3622a563ce1f96b477fa827bf0b60be8aee346b515754f3645f4d7a2ef5d4b2990610d569060038601906006870190611eed565b60405180910390a3543868929eee149b4bd2126855949350505050565b6001610d7e81611378565b3068929eee149b4bd212685403610d9d5763ab143c066000526004601cfd5b3068929eee149b4bd21268556000828152600460205260409020600180820154600160281b900460ff166006811115610dd857610dd8611ae2565b14610df657604051633ee3282d60e11b815260040160405180910390fd5b60018101805464ffffffffff421665ffffffffffff1990911617650200000000001790556002810180546001600160a01b0319163390811790915560405184907f9deed34441ca75bb2dbbe101d2201930f40e18a9ce521c77fbdca6690a89996790600090a3503868929eee149b4bd21268555050565b610e7561118b565b63389a75e1600c52806000526020600c208054421115610e9d57636f5e88186000526004601cfd5b60009055610482816111e8565b610eb261118b565b8060601b610ec857637448fbae6000526004601cfd5b610482816111e8565b63409feecd198054600382558015610f085760018160011c14303b10610eff5763f92ee8a96000526004601cfd5b818160ff1b1b91505b50610f128561165e565b610f1d8460016111a6565b610f268361169a565b600380546001600160a01b0319166001600160a01b0384161790558015610f76576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b610f85611862565b600082815260046020908152604091829020825160e08101845281548152600182015464ffffffffff81169382019390935292909190830190600160281b900460ff166006811115610fd957610fd9611ae2565b6006811115610fea57610fea611ae2565b815260018201546001600160a01b03600160301b90910481166020808401919091526002840154821660408085019190915280516080810182526003860180546001600160401b0381168352600160401b9004909416928101929092526004850154908201526005840180546060948501949293928401919061106c90611dee565b80601f016020809104026020016040519081016040528092919081815260200182805461109890611dee565b80156110e55780601f106110ba576101008083540402835291602001916110e5565b820191906000526020600020905b8154815290600101906020018083116110c857829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b828210156111715760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101611117565b505050915250909392505050565b6104978282600061173d565b638b78c6d819543314610786576382b429006000526004601cfd5b6104978282600161173d565b60008383836040516020016111c993929190611f12565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b6001600160a01b03821661124d57604051634e46966960e11b815260040160405180910390fd5b60005b81518110156113735781818151811061126b5761126b611f3a565b60200260200101516000015115611313576000836001600160a01b031683838151811061129a5761129a611f3a565b60200260200101516040015160405160006040518083038185875af1925050503d80600081146112e6576040519150601f19603f3d011682016040523d82523d6000602084013e6112eb565b606091505b505090508061130d576040516312171d8360e31b815260040160405180910390fd5b5061136b565b61136b8383838151811061132957611329611f3a565b60200260200101516040015184848151811061134757611347611f3a565b6020026020010151602001516001600160a01b03166117969092919063ffffffff16565b600101611250565b505050565b638b78c6d8600c5233600052806020600c205416610482576382b429006000526004601cfd5b6000806113a96117e6565b600081815260046020526040902081815560018101805464ffffffffff421665ffffffffffff1990911617600160281b176601000000000000600160d01b031916600160301b6001600160a01b038b1602179055925090508460038301611410828261205f565b5050341561149157604080516060810182526001808252600060208084018281523495850195865260068801805480860182559084529190922093516002909102909301805491516001600160a81b0319909216931515610100600160a81b031916939093176101006001600160a01b039092169190910217825591519101555b60005b83811015611654578484828181106114ae576114ae611f3a565b905060400201602001356000036114d857604051635972996f60e11b815260040160405180910390fd5b60008585838181106114ec576114ec611f3a565b6115029260206040909202019081019150611946565b6001600160a01b03160361152957604051635972996f60e11b815260040160405180910390fd5b82600601604051806060016040528060001515815260200187878581811061155357611553611f3a565b6115699260206040909202019081019150611946565b6001600160a01b0316815260200187878581811061158957611589611f3a565b60206040918202939093018301359093525083546001818101865560009586529482902084516002909202018054928501516001600160a01b031661010002610100600160a81b0319921515929092166001600160a81b03199093169290921717815591015191015561164c333087878581811061160957611609611f3a565b9050604002016020013588888681811061162557611625611f3a565b61163b9260206040909202019081019150611946565b6001600160a01b0316929190611804565b600101611494565b5050949350505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b0381166116e95760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b604482015260640160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c2080548381178361175f575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b816014528060345263a9059cbb60601b60005260206000604460106000875af180600160005114166117db57803d853b1517106117db576390b8ec186000526004601cfd5b506000603452505050565b60028054600091826117f783612117565b9091555050600254919050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af1806001600051141661185357803d873b15171061185357637939f4246000526004601cfd5b50600060605260405250505050565b6040805160e0810182526000808252602082018190529091820190815260200160006001600160a01b0316815260200160006001600160a01b031681526020016118df604051806080016040528060006001600160401b0316815260200160006001600160a01b0316815260200160008152602001606081525090565b8152602001606081525090565b6000602082840312156118fe57600080fd5b5035919050565b6001600160a01b038116811461048257600080fd5b6000806040838503121561192d57600080fd5b823561193881611905565b946020939093013593505050565b60006020828403121561195857600080fd5b813561196381611905565b9392505050565b6000806040838503121561197d57600080fd5b50508035926020909101359150565b6000806040838503121561199f57600080fd5b8235915060208301356119b181611905565b809150509250929050565b600080604083850312156119cf57600080fd5b823591506020830135600481106119b157600080fd5b6000806000604084860312156119fa57600080fd5b83356001600160401b0380821115611a1157600080fd5b9085019060808288031215611a2557600080fd5b90935060208501359080821115611a3b57600080fd5b818601915086601f830112611a4f57600080fd5b813581811115611a5e57600080fd5b8760208260061b8501011115611a7357600080fd5b6020830194508093505050509250925092565b60008060008060808587031215611a9c57600080fd5b8435611aa781611905565b93506020850135611ab781611905565b92506040850135611ac781611905565b91506060850135611ad781611905565b939692955090935050565b634e487b7160e01b600052602160045260246000fd5b6001600160401b0381511682526000602060018060a01b03602084015116602085015260408301516040850152606083015160806060860152805180608087015260005b81811015611b585782810184015187820160a001528301611b3c565b50600060a0828801015260a0601f19601f830116870101935050505092915050565b60008151808452602080850194506020840160005b83811015611bcc578151805115158852838101516001600160a01b0316848901526040908101519088015260609096019590820190600101611b8f565b509495945050505050565b602081528151602082015264ffffffffff60208301511660408201526000604083015160078110611c1857634e487b7160e01b600052602160045260246000fd5b806060840152506060830151611c3960808401826001600160a01b03169052565b5060808301516001600160a01b03811660a08401525060a083015160e060c0840152611c69610100840182611af8565b905060c0840151601f198483030160e0850152611c868282611b7a565b95945050505050565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038116811461048257600080fd5b600060408284031215611ccc57600080fd5b604051604081018181106001600160401b0382111715611cee57611cee611c8f565b6040528251611cfc81611ca5565b81526020830151611d0c81611905565b60208201529392505050565b600081548084526020808501945083600052602060002060005b83811015611bcc57815460ff81161515885260081c6001600160a01b031683880152600180830154604089015260609097019660029092019101611d32565b6020815260006119636020830184611d18565b600060208284031215611d9657600080fd5b813561196381611ca5565b6000808335601e19843603018112611db857600080fd5b8301803591506001600160401b03821115611dd257600080fd5b602001915036819003821315611de757600080fd5b9250929050565b600181811c90821680611e0257607f821691505b602082108103611e2257634e487b7160e01b600052602260045260246000fd5b50919050565b600081546001600160401b0381168452602060018060a01b038260401c1660208601526001915060018401546040860152600284016080606087015260008154611e7181611dee565b8060808a015260a06001831660008114611e925760018114611eae57611ede565b60ff19841660a08c015260a083151560051b8c01019450611ede565b85600052602060002060005b84811015611ed55781548d8201850152908901908801611eba565b8c0160a0019550505b50929998505050505050505050565b604081526000611f006040830185611e28565b8281036020840152611c868185611d18565b8381526001600160401b0383166020820152606060408201526000611c866060830184611e28565b634e487b7160e01b600052603260045260246000fd5b601f821115611373576000816000526020600020601f850160051c81016020861015611f795750805b601f850160051c820191505b81811015611f9857828155600101611f85565b505050505050565b6001600160401b03831115611fb757611fb7611c8f565b611fcb83611fc58354611dee565b83611f50565b6000601f841160018114611fff5760008515611fe75750838201355b600019600387901b1c1916600186901b178355610f76565b600083815260209020601f19861690835b828110156120305786850135825560209485019460019092019101612010565b508682101561204d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813561206a81611ca5565b6001600160401b0380821691508254826001600160401b03198216178455602085013561209681611905565b6001600160e01b031991909116909217604092831b68010000000000000000600160e01b031617835590830135600183015560608301359036849003601e190182126120e157600080fd5b908301908135818111156120f457600080fd5b60208301925080360383131561210957600080fd5b610f76818460028701611fa0565b60006001820161213757634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220a8b1701179a52b824f9abad4f49c3f5214b745cf0408c01b2e6d4549a4e7d4f264736f6c63430008180033", + ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"accept\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancel\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"cancelOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"claim\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"to\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"completeOwnershipHandover\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deployedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getLatestRequestByStatus\",\"inputs\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structSolve.Request\",\"components\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"updatedAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"acceptedBy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"updateHistory\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.StatusUpdate[]\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"timestamp\",\"type\":\"uint40\",\"internalType\":\"uint40\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequest\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structSolve.Request\",\"components\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"updatedAt\",\"type\":\"uint40\",\"internalType\":\"uint40\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"from\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"acceptedBy\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]},{\"name\":\"updateHistory\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.StatusUpdate[]\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"timestamp\",\"type\":\"uint40\",\"internalType\":\"uint40\"}]}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"getRequestUpdateHistory\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.StatusUpdate[]\",\"components\":[{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumSolve.Status\"},{\"name\":\"timestamp\",\"type\":\"uint40\",\"internalType\":\"uint40\"}]}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"grantRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"hasAllRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasAnyRole\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"solver_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"omni_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"outbox_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"markFulfilled\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"callHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"result\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownershipHandoverExpiresAt\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"result\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"reject\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"reason\",\"type\":\"uint8\",\"internalType\":\"enumSolve.RejectReason\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceRoles\",\"inputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"request\",\"inputs\":[{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.TokenDeposit[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"requestOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"revokeRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"rolesOf\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"Accepted\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Claimed\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"to\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Fulfilled\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"creditedTo\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverCanceled\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverRequested\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Rejected\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"by\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"reason\",\"type\":\"uint8\",\"indexed\":true,\"internalType\":\"enumSolve.RejectReason\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Requested\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"from\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"call\",\"type\":\"tuple\",\"indexed\":false,\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"deposits\",\"type\":\"tuple[]\",\"indexed\":false,\"internalType\":\"structSolve.Deposit[]\",\"components\":[{\"name\":\"isNative\",\"type\":\"bool\",\"internalType\":\"bool\"},{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Reverted\",\"inputs\":[{\"name\":\"id\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RolesUpdated\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyInitialized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidCall\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidDeposit\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidRecipient\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewOwnerIsZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoDeposits\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoHandoverRequest\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotAccepted\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotFulfilled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotOutbox\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotPending\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotPendingOrRejected\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Reentrancy\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"TransferFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongCallHash\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongSourceChain\",\"inputs\":[]}]", + Bin: "0x60a06040523480156200001157600080fd5b5063ffffffff60643b1615620000975760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156200007f575060408051601f3d908101601f191682019092526200007c9181019062000110565b60015b6200008e57436080526200009c565b6080526200009c565b436080525b620000a6620000ac565b6200012a565b63409feecd1980546001811615620000cc5763f92ee8a96000526004601cfd5b8160c01c808260011c146200010b578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012357600080fd5b5051919050565b608051612b316200014660003960006104400152612b316000f3fe6080604052600436106101815760003560e01c80637667fd69116100d1578063e4725ba11161008a578063f2fde38b11610064578063f2fde38b14610475578063f8c8765e14610488578063fb1e61ca146104a8578063fee81cf4146104c857600080fd5b8063e4725ba11461040e578063eae4c19f1461042e578063f04e283e1461046257600080fd5b80637667fd69146103555780638da5cb5b1461038257806396c144f01461039b578063c4d252f5146103bb578063db3ea553146103db578063e17771c8146103fb57600080fd5b806339acf9f11161013e57806354d1f13d1161011857806354d1f13d146102e557806369c1f780146102ed578063715018a61461031a57806374eeb8471461032257600080fd5b806339acf9f1146102635780634a4ee7b11461029b578063514e62fc146102ae57600080fd5b8063183a4f6e146101865780631c10893f1461019b5780631cd64df4146101ae57806325692962146101fa5780632de9480714610202578063337ffe2014610243575b600080fd5b6101996101943660046121b3565b6104fb565b005b6101996101a93660046121e1565b610508565b3480156101ba57600080fd5b506101e56101c93660046121e1565b638b78c6d8600c90815260009290925260209091205481161490565b60405190151581526020015b60405180910390f35b61019961051e565b34801561020e57600080fd5b5061023561021d36600461220d565b638b78c6d8600c908152600091909152602090205490565b6040519081526020016101f1565b34801561024f57600080fd5b5061019961025e366004612231565b61056d565b34801561026f57600080fd5b50600054610283906001600160a01b031681565b6040516001600160a01b0390911681526020016101f1565b6101996102a93660046121e1565b61084b565b3480156102ba57600080fd5b506101e56102c93660046121e1565b638b78c6d8600c90815260009290925260209091205416151590565b61019961085d565b3480156102f957600080fd5b5061030d6103083660046121b3565b610899565b6040516101f191906122ad565b610199610949565b34801561032e57600080fd5b5060005461034390600160a01b900460ff1681565b60405160ff90911681526020016101f1565b34801561036157600080fd5b506103756103703660046122f6565b61095d565b6040516101f1919061242c565b34801561038e57600080fd5b50638b78c6d81954610283565b3480156103a757600080fd5b506101996103b63660046124f0565b610c37565b3480156103c757600080fd5b506101996103d63660046121b3565b610e8f565b3480156103e757600080fd5b506101996103f6366004612520565b6110fc565b610235610409366004612549565b61129b565b34801561041a57600080fd5b506101996104293660046121b3565b61140f565b34801561043a57600080fd5b506102357f000000000000000000000000000000000000000000000000000000000000000081565b61019961047036600461220d565b6115ad565b61019961048336600461220d565b6115ea565b34801561049457600080fd5b506101996104a33660046125ea565b611611565b3480156104b457600080fd5b506103756104c33660046121b3565b6116bd565b3480156104d457600080fd5b506102356104e336600461220d565b63389a75e1600c908152600091909152602090205490565b610505338261194c565b50565b610510611958565b61051a8282611973565b5050565b60006202a3006001600160401b03164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b60005460408051631799380760e11b815281516001600160a01b0390931692632f32700e926004808401939192918290030181865afa1580156105b4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105d89190612671565b8051600180546020909301516001600160a01b0316600160401b026001600160e01b03199093166001600160401b039092169190911791909117905568929eee149b4bd21268543090036106345763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060026001820154600160281b900460ff16600681111561067057610670612253565b1461068e5760405163029d79a560e41b815260040160405180910390fd5b600354600154600160401b90046001600160a01b039081169116146106c65760405163bda8fc9560e01b815260040160405180910390fd5b60038101546001546001600160401b039081169116146106f957604051633687f39960e21b815260040160405180910390fd5b61070783468360030161197f565b821461072657604051631c6060ab60e11b815260040160405180910390fd5b60408051808201909152600581524264ffffffffff1660208083018290526001848101805465ffffffffffff19169093176505000000000017909255600784018054808401825560009182529190208351910180548493919291839160ff19169083600681111561079957610799612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff00199091161790556005600081815291527f458b30c2d72bfd2c6317304a4594ecbafe5f729d3111b65fdc3a33bd48e5432d85905560028301546040516001600160a01b0390911691859187917f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89191a450503868929eee149b4bd21268555050600180546001600160e01b0319169055565b610853611958565b61051a828261194c565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b606060046000838152602001908152602001600020600701805480602002602001604051908101604052809291908181526020016000905b8282101561093e57600084815260209020604080518082019091529083018054829060ff16600681111561090757610907612253565b600681111561091857610918612253565b81529054610100900464ffffffffff1660209182015290825260019290920191016108d1565b505050509050919050565b610951611958565b61095b60006119b5565b565b610965612121565b600460006005600085600681111561097f5761097f612253565b600681111561099057610990612253565b8152602080820192909252604090810160009081205484528383019490945291820190922081516101008101835281548152600182015464ffffffffff811694820194909452929091830190600160281b900460ff1660068111156109f7576109f7612253565b6006811115610a0857610a08612253565b815260018201546001600160a01b03600160301b90910481166020808401919091526002840154821660408085019190915280516080810182526003860180546001600160401b0381168352600160401b90049094169281019290925260048501549082015260058401805460609485019492939284019190610a8a906126cf565b80601f0160208091040260200160405190810160405280929190818152602001828054610ab6906126cf565b8015610b035780601f10610ad857610100808354040283529160200191610b03565b820191906000526020600020905b815481529060010190602001808311610ae657829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015610b8f5760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101610b35565b50505050815260200160078201805480602002602001604051908101604052809291908181526020016000905b82821015610c2957600084815260209020604080518082019091529083018054829060ff166006811115610bf257610bf2612253565b6006811115610c0357610c03612253565b81529054610100900464ffffffffff166020918201529082526001929092019101610bbc565b505050915250909392505050565b3068929eee149b4bd212685403610c565763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060056001820154600160281b900460ff166006811115610c9257610c92612253565b14610cb0576040516303de361f60e11b815260040160405180910390fd5b60028101546001600160a01b03163314610cdc576040516282b42960e81b815260040160405180910390fd5b6040805180820190915260068082524264ffffffffff1660208084018290526001858101805465ffffffffffff191690931765060000000000179092556007850180548084018255600091825291902084519101805485949193849260ff19909216918490811115610d5057610d50612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff001990911617905560066000818152600583527f069400f22b28c6c362558d92f66163cec5671cba50b61abd2eecfcd0eaeac51887905590840180546040805182860281018601909152818152610e2e948894919392919084015b82821015610e255760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101610dcb565b505050506119f3565b826001600160a01b0316336001600160a01b0316857f1291cec4ea55732527f1ae8ff3e53def0dbe1feb99c094983449e59cdce4674b85600601604051610e759190612762565b60405180910390a450503868929eee149b4bd21268555050565b3068929eee149b4bd212685403610eae5763ab143c066000526004601cfd5b3068929eee149b4bd21268556000818152600460205260409020600180820154600160281b900460ff166006811115610ee957610ee9612253565b14158015610f17575060036001820154600160281b900460ff166006811115610f1457610f14612253565b14155b15610f3557604051631fa4148760e21b815260040160405180910390fd5b6001810154600160301b90046001600160a01b03163314610f68576040516282b42960e81b815260040160405180910390fd5b60408051808201909152600481524264ffffffffff1660208083018290526001848101805465ffffffffffff19169093176504000000000017909255600784018054808401825560009182529190208351910180548493919291839160ff191690836006811115610fdb57610fdb612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff001990911617905560046000908152600582527f3eec716f11ba9e820c81ca75eb978ffb45831ef8b7a53e5e422c26008e1ca6d5859055600184015460068501805460408051828702810187019091528181526110c095600160301b9094046001600160a01b031694909384018215610e255760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101610dcb565b60405183907fb66b13449e4bb2c30749a37f3081f1988fcee5ff5d98ce740b354d4e2d94409590600090a250503868929eee149b4bd212685550565b600161110781611b45565b3068929eee149b4bd2126854036111265763ab143c066000526004601cfd5b3068929eee149b4bd21268556000838152600460205260409020600180820154600160281b900460ff16600681111561116157611161612253565b1461117f57604051633ee3282d60e11b815260040160405180910390fd5b60408051808201909152600381524264ffffffffff1660208083018290526001848101805465ffffffffffff19169093176503000000000017909255600784018054808401825560009182529190208351910180548493919291839160ff1916908360068111156111f2576111f2612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff00199091161790556003600081905260059091527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc0869055849081111561125b5761125b612253565b604051339087907f21f84ee3a6e9bc7c10f855f8c9829e22c613861cef10add09eccdbc88df9f59f90600090a450503868929eee149b4bd2126855505050565b60003068929eee149b4bd2126854036112bc5763ab143c066000526004601cfd5b3068929eee149b4bd212685560006112da604086016020870161220d565b6001600160a01b0316036113015760405163574b16a760e11b815260040160405180910390fd5b61130e6020850185612775565b6001600160401b03166000036113375760405163574b16a760e11b815260040160405180910390fd5b6113446060850185612792565b90506000036113665760405163574b16a760e11b815260040160405180910390fd5b81158015611372575034155b1561139057604051630558800760e21b815260040160405180910390fd5b600061139e33868686611b6b565b60018101548154604051929350600160301b9091046001600160a01b0316917f3622a563ce1f96b477fa827bf0b60be8aee346b515754f3645f4d7a2ef5d4b29906113f290600386019060068701906128a4565b60405180910390a3543868929eee149b4bd2126855949350505050565b600161141a81611b45565b3068929eee149b4bd2126854036114395763ab143c066000526004601cfd5b3068929eee149b4bd21268556000828152600460205260409020600180820154600160281b900460ff16600681111561147457611474612253565b1461149257604051633ee3282d60e11b815260040160405180910390fd5b6040805180820190915260028082524264ffffffffff1660208084018290526001858101805465ffffffffffff1916909317650200000000001790925591840180546001600160a01b031916331790556007840180548083018255600091825292902083519201805484939192839160ff19169083600681111561151857611518612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff00199091161790556002600090815260059091527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a859055604051339186917f9deed34441ca75bb2dbbe101d2201930f40e18a9ce521c77fbdca6690a8999679190a350503868929eee149b4bd21268555050565b6115b5611958565b63389a75e1600c52806000526020600c2080544211156115dd57636f5e88186000526004601cfd5b60009055610505816119b5565b6115f2611958565b8060601b61160857637448fbae6000526004601cfd5b610505816119b5565b63409feecd1980546003825580156116485760018160011c14303b1061163f5763f92ee8a96000526004601cfd5b818160ff1b1b91505b5061165285611f1d565b61165d846001611973565b61166683611f59565b600380546001600160a01b0319166001600160a01b03841617905580156116b6576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b6116c5612121565b60008281526004602090815260409182902082516101008101845281548152600182015464ffffffffff81169382019390935292909190830190600160281b900460ff16600681111561171a5761171a612253565b600681111561172b5761172b612253565b815260018201546001600160a01b03600160301b90910481166020808401919091526002840154821660408085019190915280516080810182526003860180546001600160401b0381168352600160401b900490941692810192909252600485015490820152600584018054606094850194929392840191906117ad906126cf565b80601f01602080910402602001604051908101604052809291908181526020018280546117d9906126cf565b80156118265780601f106117fb57610100808354040283529160200191611826565b820191906000526020600020905b81548152906001019060200180831161180957829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b828210156118b25760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101611858565b50505050815260200160078201805480602002602001604051908101604052809291908181526020016000905b82821015610c2957600084815260209020604080518082019091529083018054829060ff16600681111561191557611915612253565b600681111561192657611926612253565b81529054610100900464ffffffffff1660209182015290825260019290920191016118df565b61051a82826000611ffc565b638b78c6d81954331461095b576382b429006000526004601cfd5b61051a82826001611ffc565b6000838383604051602001611996939291906128d2565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b6001600160a01b038216611a1a57604051634e46966960e11b815260040160405180910390fd5b60005b8151811015611b4057818181518110611a3857611a386128fa565b60200260200101516000015115611ae0576000836001600160a01b0316838381518110611a6757611a676128fa565b60200260200101516040015160405160006040518083038185875af1925050503d8060008114611ab3576040519150601f19603f3d011682016040523d82523d6000602084013e611ab8565b606091505b5050905080611ada576040516312171d8360e31b815260040160405180910390fd5b50611b38565b611b3883838381518110611af657611af66128fa565b602002602001015160400151848481518110611b1457611b146128fa565b6020026020010151602001516001600160a01b03166120559092919063ffffffff16565b600101611a1d565b505050565b638b78c6d8600c5233600052806020600c205416610505576382b429006000526004601cfd5b600080611b766120a5565b90506000604051806040016040528060016006811115611b9857611b98612253565b815264ffffffffff42811660209283015260008581526004835260409020858155918301516001830180549190921664ffffffffff1982168117835584519397509394509192909165ffffffffffff191617600160281b836006811115611c0157611c01612253565b02179055506001830180546601000000000000600160d01b031916600160301b6001600160a01b038a16021790558560038401611c3e8282612a1f565b505060078301805460018181018355600092835260209092208351910180548493919291839160ff191690836006811115611c7b57611c7b612253565b0217905550602091820151815464ffffffffff9091166101000265ffffffffff00199091161790556001600052600590527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b8290553415611d4f57604080516060810182526001808252600060208084018281523495850195865260068901805480860182559084529190922093516002909102909301805491516001600160a81b0319909216931515610100600160a81b031916939093176101006001600160a01b039092169190910217825591519101555b60005b84811015611f1257858582818110611d6c57611d6c6128fa565b90506040020160200135600003611d9657604051635972996f60e11b815260040160405180910390fd5b6000868683818110611daa57611daa6128fa565b611dc0926020604090920201908101915061220d565b6001600160a01b031603611de757604051635972996f60e11b815260040160405180910390fd5b836006016040518060600160405280600015158152602001888885818110611e1157611e116128fa565b611e27926020604090920201908101915061220d565b6001600160a01b03168152602001888885818110611e4757611e476128fa565b60206040918202939093018301359093525083546001818101865560009586529482902084516002909202018054928501516001600160a01b031661010002610100600160a81b0319921515929092166001600160a81b031990931692909217178155910151910155611f0a3330888885818110611ec757611ec76128fa565b90506040020160200135898986818110611ee357611ee36128fa565b611ef9926020604090920201908101915061220d565b6001600160a01b03169291906120c3565b600101611d52565b505050949350505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b038116611fa85760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b604482015260640160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c2080548381178361201e575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b816014528060345263a9059cbb60601b60005260206000604460106000875af1806001600051141661209a57803d853b15171061209a576390b8ec186000526004601cfd5b506000603452505050565b60028054600091826120b683612ad4565b9091555050600254919050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af1806001600051141661211257803d873b15171061211257637939f4246000526004601cfd5b50600060605260405250505050565b60408051610100810182526000808252602082018190529091820190815260200160006001600160a01b0316815260200160006001600160a01b0316815260200161219f604051806080016040528060006001600160401b0316815260200160006001600160a01b0316815260200160008152602001606081525090565b815260200160608152602001606081525090565b6000602082840312156121c557600080fd5b5035919050565b6001600160a01b038116811461050557600080fd5b600080604083850312156121f457600080fd5b82356121ff816121cc565b946020939093013593505050565b60006020828403121561221f57600080fd5b813561222a816121cc565b9392505050565b6000806040838503121561224457600080fd5b50508035926020909101359150565b634e487b7160e01b600052602160045260246000fd5b6007811061228757634e487b7160e01b600052602160045260246000fd5b9052565b612296828251612269565b60209081015164ffffffffff169082015260400190565b6020808252825182820181905260009190848201906040850190845b818110156122ea576122dc83855161228b565b9385019392506001016122c9565b50909695505050505050565b60006020828403121561230857600080fd5b81356007811061222a57600080fd5b6001600160401b0381511682526000602060018060a01b03602084015116602085015260408301516040850152606083015160806060860152805180608087015260005b818110156123775782810184015187820160a00152830161235b565b50600060a0828801015260a0601f19601f830116870101935050505092915050565b60008151808452602080850194506020840160005b838110156123eb578151805115158852838101516001600160a01b03168489015260409081015190880152606090960195908201906001016123ae565b509495945050505050565b60008151808452602080850194506020840160005b838110156123eb5761241e87835161228b565b96509082019060010161240b565b602081528151602082015260006020830151612451604084018264ffffffffff169052565b5060408301516124646060840182612269565b5060608301516001600160a01b03811660808401525060808301516001600160a01b03811660a08401525060a08301516101008060c08501526124ab610120850183612317565b915060c0850151601f19808685030160e08701526124c98483612399565b935060e08701519150808685030183870152506124e683826123f6565b9695505050505050565b6000806040838503121561250357600080fd5b823591506020830135612515816121cc565b809150509250929050565b6000806040838503121561253357600080fd5b8235915060208301356004811061251557600080fd5b60008060006040848603121561255e57600080fd5b83356001600160401b038082111561257557600080fd5b908501906080828803121561258957600080fd5b9093506020850135908082111561259f57600080fd5b818601915086601f8301126125b357600080fd5b8135818111156125c257600080fd5b8760208260061b85010111156125d757600080fd5b6020830194508093505050509250925092565b6000806000806080858703121561260057600080fd5b843561260b816121cc565b9350602085013561261b816121cc565b9250604085013561262b816121cc565b9150606085013561263b816121cc565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b6001600160401b038116811461050557600080fd5b60006040828403121561268357600080fd5b604051604081018181106001600160401b03821117156126a5576126a5612646565b60405282516126b38161265c565b815260208301516126c3816121cc565b60208201529392505050565b600181811c908216806126e357607f821691505b60208210810361270357634e487b7160e01b600052602260045260246000fd5b50919050565b600081548084526020808501945083600052602060002060005b838110156123eb57815460ff81161515885260081c6001600160a01b031683880152600180830154604089015260609097019660029092019101612723565b60208152600061222a6020830184612709565b60006020828403121561278757600080fd5b813561222a8161265c565b6000808335601e198436030181126127a957600080fd5b8301803591506001600160401b038211156127c357600080fd5b6020019150368190038213156127d857600080fd5b9250929050565b600081546001600160401b0381168452602060018060a01b038260401c1660208601526001915060018401546040860152600284016080606087015260008154612828816126cf565b8060808a015260a06001831660008114612849576001811461286557612895565b60ff19841660a08c015260a083151560051b8c01019450612895565b85600052602060002060005b8481101561288c5781548d8201850152908901908801612871565b8c0160a0019550505b50929998505050505050505050565b6040815260006128b760408301856127df565b82810360208401526128c98185612709565b95945050505050565b8381526001600160401b03831660208201526060604082015260006128c960608301846127df565b634e487b7160e01b600052603260045260246000fd5b601f821115611b40576000816000526020600020601f850160051c810160208610156129395750805b601f850160051c820191505b8181101561295857828155600101612945565b505050505050565b6001600160401b0383111561297757612977612646565b61298b8361298583546126cf565b83612910565b6000601f8411600181146129bf57600085156129a75750838201355b600019600387901b1c1916600186901b1783556116b6565b600083815260209020601f19861690835b828110156129f057868501358255602094850194600190920191016129d0565b5086821015612a0d5760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b8135612a2a8161265c565b6001600160401b0380821691508254826001600160401b031982161784556020850135612a56816121cc565b6001600160e01b031991909116909217604092831b68010000000000000000600160e01b0316178355908301356001830155600090606084013536859003601e19018112612aa2578283fd5b8401803582811115612ab2578384fd5b602082019250803603831315612ac6578384fd5b612958818460028801612960565b600060018201612af457634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122028a489d723638afed0a8965b5786699b20bd254a3837cabb1120b5c46e85e67864736f6c63430008180033", } // SolveInboxABI is the input ABI used to generate the binding from. @@ -296,9 +303,40 @@ func (_SolveInbox *SolveInboxCallerSession) DeployedAt() (*big.Int, error) { return _SolveInbox.Contract.DeployedAt(&_SolveInbox.CallOpts) } +// GetLatestRequestByStatus is a free data retrieval call binding the contract method 0x7667fd69. +// +// Solidity: function getLatestRequestByStatus(uint8 status) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) +func (_SolveInbox *SolveInboxCaller) GetLatestRequestByStatus(opts *bind.CallOpts, status uint8) (SolveRequest, error) { + var out []interface{} + err := _SolveInbox.contract.Call(opts, &out, "getLatestRequestByStatus", status) + + if err != nil { + return *new(SolveRequest), err + } + + out0 := *abi.ConvertType(out[0], new(SolveRequest)).(*SolveRequest) + + return out0, err + +} + +// GetLatestRequestByStatus is a free data retrieval call binding the contract method 0x7667fd69. +// +// Solidity: function getLatestRequestByStatus(uint8 status) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) +func (_SolveInbox *SolveInboxSession) GetLatestRequestByStatus(status uint8) (SolveRequest, error) { + return _SolveInbox.Contract.GetLatestRequestByStatus(&_SolveInbox.CallOpts, status) +} + +// GetLatestRequestByStatus is a free data retrieval call binding the contract method 0x7667fd69. +// +// Solidity: function getLatestRequestByStatus(uint8 status) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) +func (_SolveInbox *SolveInboxCallerSession) GetLatestRequestByStatus(status uint8) (SolveRequest, error) { + return _SolveInbox.Contract.GetLatestRequestByStatus(&_SolveInbox.CallOpts, status) +} + // GetRequest is a free data retrieval call binding the contract method 0xfb1e61ca. // -// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[])) +// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) func (_SolveInbox *SolveInboxCaller) GetRequest(opts *bind.CallOpts, id [32]byte) (SolveRequest, error) { var out []interface{} err := _SolveInbox.contract.Call(opts, &out, "getRequest", id) @@ -315,18 +353,49 @@ func (_SolveInbox *SolveInboxCaller) GetRequest(opts *bind.CallOpts, id [32]byte // GetRequest is a free data retrieval call binding the contract method 0xfb1e61ca. // -// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[])) +// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) func (_SolveInbox *SolveInboxSession) GetRequest(id [32]byte) (SolveRequest, error) { return _SolveInbox.Contract.GetRequest(&_SolveInbox.CallOpts, id) } // GetRequest is a free data retrieval call binding the contract method 0xfb1e61ca. // -// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[])) +// Solidity: function getRequest(bytes32 id) view returns((bytes32,uint40,uint8,address,address,(uint64,address,uint256,bytes),(bool,address,uint256)[],(uint8,uint40)[])) func (_SolveInbox *SolveInboxCallerSession) GetRequest(id [32]byte) (SolveRequest, error) { return _SolveInbox.Contract.GetRequest(&_SolveInbox.CallOpts, id) } +// GetRequestUpdateHistory is a free data retrieval call binding the contract method 0x69c1f780. +// +// Solidity: function getRequestUpdateHistory(bytes32 id) view returns((uint8,uint40)[]) +func (_SolveInbox *SolveInboxCaller) GetRequestUpdateHistory(opts *bind.CallOpts, id [32]byte) ([]SolveStatusUpdate, error) { + var out []interface{} + err := _SolveInbox.contract.Call(opts, &out, "getRequestUpdateHistory", id) + + if err != nil { + return *new([]SolveStatusUpdate), err + } + + out0 := *abi.ConvertType(out[0], new([]SolveStatusUpdate)).(*[]SolveStatusUpdate) + + return out0, err + +} + +// GetRequestUpdateHistory is a free data retrieval call binding the contract method 0x69c1f780. +// +// Solidity: function getRequestUpdateHistory(bytes32 id) view returns((uint8,uint40)[]) +func (_SolveInbox *SolveInboxSession) GetRequestUpdateHistory(id [32]byte) ([]SolveStatusUpdate, error) { + return _SolveInbox.Contract.GetRequestUpdateHistory(&_SolveInbox.CallOpts, id) +} + +// GetRequestUpdateHistory is a free data retrieval call binding the contract method 0x69c1f780. +// +// Solidity: function getRequestUpdateHistory(bytes32 id) view returns((uint8,uint40)[]) +func (_SolveInbox *SolveInboxCallerSession) GetRequestUpdateHistory(id [32]byte) ([]SolveStatusUpdate, error) { + return _SolveInbox.Contract.GetRequestUpdateHistory(&_SolveInbox.CallOpts, id) +} + // HasAllRoles is a free data retrieval call binding the contract method 0x1cd64df4. // // Solidity: function hasAllRoles(address user, uint256 roles) view returns(bool) diff --git a/contracts/bindings/solveoutbox.go b/contracts/bindings/solveoutbox.go index 97e0ff81d..cfb5062ae 100644 --- a/contracts/bindings/solveoutbox.go +++ b/contracts/bindings/solveoutbox.go @@ -48,7 +48,7 @@ type SolveTokenPrereq struct { // SolveOutboxMetaData contains all meta data concerning the SolveOutbox contract. var SolveOutboxMetaData = &bind.MetaData{ ABI: "[{\"type\":\"constructor\",\"inputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"allowedCalls\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"selector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"cancelOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"completeOwnershipHandover\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"defaultConfLevel\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint8\",\"internalType\":\"uint8\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"deployedAt\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"didFulfill\",\"inputs\":[{\"name\":\"srcReqId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"srcChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"fulfill\",\"inputs\":[{\"name\":\"srcReqId\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"srcChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"call\",\"type\":\"tuple\",\"internalType\":\"structSolve.Call\",\"components\":[{\"name\":\"destChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"value\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"data\",\"type\":\"bytes\",\"internalType\":\"bytes\"}]},{\"name\":\"prereqs\",\"type\":\"tuple[]\",\"internalType\":\"structSolve.TokenPrereq[]\",\"components\":[{\"name\":\"token\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"fulfillFee\",\"inputs\":[{\"name\":\"srcChainId\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"fulfilledCalls\",\"inputs\":[{\"name\":\"callHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"fulfilled\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"grantRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"hasAllRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"hasAnyRole\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"initialize\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"solver_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"omni_\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"inbox_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"omni\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"contractIOmniPortal\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"owner\",\"inputs\":[],\"outputs\":[{\"name\":\"result\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"ownershipHandoverExpiresAt\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"result\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"renounceOwnership\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"renounceRoles\",\"inputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"requestOwnershipHandover\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"revokeRoles\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"function\",\"name\":\"rolesOf\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"roles\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"type\":\"function\",\"name\":\"setAllowedCall\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"selector\",\"type\":\"bytes4\",\"internalType\":\"bytes4\"},{\"name\":\"allowed\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"type\":\"function\",\"name\":\"transferOwnership\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"type\":\"event\",\"name\":\"AllowedCallSet\",\"inputs\":[{\"name\":\"target\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"selector\",\"type\":\"bytes4\",\"indexed\":true,\"internalType\":\"bytes4\"},{\"name\":\"allowed\",\"type\":\"bool\",\"indexed\":false,\"internalType\":\"bool\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"DefaultConfLevelSet\",\"inputs\":[{\"name\":\"conf\",\"type\":\"uint8\",\"indexed\":false,\"internalType\":\"uint8\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Fulfilled\",\"inputs\":[{\"name\":\"reqId\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"callHash\",\"type\":\"bytes32\",\"indexed\":true,\"internalType\":\"bytes32\"},{\"name\":\"solvedBy\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"Initialized\",\"inputs\":[{\"name\":\"version\",\"type\":\"uint64\",\"indexed\":false,\"internalType\":\"uint64\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OmniPortalSet\",\"inputs\":[{\"name\":\"omni\",\"type\":\"address\",\"indexed\":false,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverCanceled\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipHandoverRequested\",\"inputs\":[{\"name\":\"pendingOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"inputs\":[{\"name\":\"oldOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"newOwner\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"}],\"anonymous\":false},{\"type\":\"event\",\"name\":\"RolesUpdated\",\"inputs\":[{\"name\":\"user\",\"type\":\"address\",\"indexed\":true,\"internalType\":\"address\"},{\"name\":\"roles\",\"type\":\"uint256\",\"indexed\":true,\"internalType\":\"uint256\"}],\"anonymous\":false},{\"type\":\"error\",\"name\":\"AlreadyInitialized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"AreadyFulfilled\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CallFailed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"CallNotAllowed\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"IncorrectPrereqs\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InsufficientFee\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"InvalidInitialization\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NewOwnerIsZeroAddress\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NoHandoverRequest\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"NotInitializing\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Reentrancy\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"Unauthorized\",\"inputs\":[]},{\"type\":\"error\",\"name\":\"WrongDestChain\",\"inputs\":[]}]", - Bin: "0x60a06040523480156200001157600080fd5b504661a4b1141580156200002857504662066eee14155b15620000385743608052620000a2565b60646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000078573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200009e919062000116565b6080525b620000ac620000b2565b62000130565b63409feecd1980546001811615620000d25763f92ee8a96000526004601cfd5b8160c01c808260011c1462000111578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012957600080fd5b5051919050565b60805161162e6200014c60003960006103d0015261162e6000f3fe6080604052600436106101405760003560e01c80635ba15647116100b6578063cb01a09a1161006f578063cb01a09a146103ab578063eae4c19f146103be578063f04e283e146103f2578063f2fde38b14610405578063f8c8765e14610418578063fee81cf41461043857600080fd5b80635ba15647146102cc5780635db9cbe4146102ec578063715018a61461031c57806374eeb847146103245780638da5cb5b14610357578063b23ade801461037057600080fd5b80632b370b67116101085780632b370b67146101ef5780632de948071461020f57806339acf9f1146102425780634a4ee7b11461027a578063514e62fc1461028d57806354d1f13d146102c457600080fd5b8063183a4f6e14610145578063188a97aa1461015a5780631c10893f1461018d5780631cd64df4146101a057806325692962146101e7575b600080fd5b6101586101533660046110a1565b61046b565b005b34801561016657600080fd5b5061017a6101753660046110d7565b610478565b6040519081526020015b60405180910390f35b61015861019b366004611110565b6104cf565b3480156101ac57600080fd5b506101d76101bb366004611110565b638b78c6d8600c90815260009290925260209091205481161490565b6040519015158152602001610184565b6101586104e5565b3480156101fb57600080fd5b5061015861020a366004611152565b610535565b34801561021b57600080fd5b5061017a61022a36600461119e565b638b78c6d8600c908152600091909152602090205490565b34801561024e57600080fd5b50600054610262906001600160a01b031681565b6040516001600160a01b039091168152602001610184565b610158610288366004611110565b6105b4565b34801561029957600080fd5b506101d76102a8366004611110565b638b78c6d8600c90815260009290925260209091205416151590565b6101586105c6565b3480156102d857600080fd5b506101d76102e73660046111d1565b610602565b3480156102f857600080fd5b506101d76103073660046110a1565b60046020526000908152604090205460ff1681565b61015861062f565b34801561033057600080fd5b5060005461034590600160a01b900460ff1681565b60405160ff9091168152602001610184565b34801561036357600080fd5b50638b78c6d81954610262565b34801561037c57600080fd5b506101d761038b366004611228565b600360209081526000928352604080842090915290825290205460ff1681565b6101586103b936600461125b565b610643565b3480156103ca57600080fd5b5061017a7f000000000000000000000000000000000000000000000000000000000000000081565b61015861040036600461119e565b610af4565b61015861041336600461119e565b610b31565b34801561042457600080fd5b5061015861043336600461130d565b610b58565b34801561044457600080fd5b5061017a61045336600461119e565b63389a75e1600c908152600091909152602090205490565b6104753382610c04565b50565b6040516000196024820181905260448201526000906104c990839060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052620186a0610c10565b92915050565b6104d7610c8e565b6104e18282610ca9565b5050565b60006202a30067ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b61053d610c8e565b6001600160a01b03831660008181526003602090815260408083206001600160e01b0319871680855290835292819020805460ff191686151590811790915590519081529192917f4a2dc3dabd793cd88cb7b56ba4aa70196892e5b996fc72f4f3d45e20343d305b910160405180910390a3505050565b6105bc610c8e565b6104e18282610c04565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b600060046000610613868686610cb5565b815260208101919091526040016000205460ff16949350505050565b610637610c8e565b6106416000610ceb565b565b600161064e81610d29565b3068929eee149b4bd21268540361066d5763ab143c066000526004601cfd5b3068929eee149b4bd21268554661068760208601866110d7565b67ffffffffffffffff16146106af5760405163fd24301760e01b815260040160405180910390fd5b600360006106c3604087016020880161119e565b6001600160a01b0316815260208101919091526040016000908120906106ec6060870187611361565b6106f5916113af565b6001600160e01b031916815260208101919091526040016000205460ff16610730576040516315dace2d60e21b815260040160405180910390fd5b600061073d878787610cb5565b60008181526004602052604090205490915060ff161561077057604051630c4a31a760e01b815260040160405180910390fd5b6000818152600460205260408120805460ff191660011790558367ffffffffffffffff8111156107a2576107a26113df565b6040519080825280602002602001820160405280156107cb578160200160208202803683370190505b50905060005b8481101561091557610814308787848181106107ef576107ef6113f5565b610805926020606090920201908101915061119e565b6001600160a01b031690610d4f565b828281518110610826576108266113f5565b60200260200101818152505061088c3330888885818110610849576108496113f5565b90506060020160400135898986818110610865576108656113f5565b61087b926020606090920201908101915061119e565b6001600160a01b0316929190610d7b565b61090d8686838181106108a1576108a16113f5565b90506060020160200160208101906108b9919061119e565b8787848181106108cb576108cb6113f5565b905060600201604001358888858181106108e7576108e76113f5565b6108fd926020606090920201908101915061119e565b6001600160a01b03169190610dd9565b6001016107d1565b506000610928604088016020890161119e565b6001600160a01b0316604088013561094360608a018a611361565b60405161095192919061140b565b60006040518083038185875af1925050503d806000811461098e576040519150601f19603f3d011682016040523d82523d6000602084013e610993565b606091505b50509050806109b557604051633204506f60e01b815260040160405180910390fd5b60005b85811015610a16578281815181106109d2576109d26113f5565b60200260200101516109f0308989858181106107ef576107ef6113f5565b14610a0e5760405163903c78cd60e01b815260040160405180910390fd5b6001016109b8565b50604051602481018a90526044810184905260009060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052600254909150600090610a7d908b906004906001600160a01b031685620186a0610e29565b905080610a8e60408b01353461141b565b1015610aac5760405162976f7560e21b815260040160405180910390fd5b604051339086908d907f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89190600090a450505050503868929eee149b4bd2126855505050505050565b610afc610c8e565b63389a75e1600c52806000526020600c208054421115610b2457636f5e88186000526004601cfd5b6000905561047581610ceb565b610b39610c8e565b8060601b610b4f57637448fbae6000526004601cfd5b61047581610ceb565b63409feecd198054600382558015610b8f5760018160011c14303b10610b865763f92ee8a96000526004601cfd5b818160ff1b1b91505b50610b9985610f6d565b610ba4846001610ca9565b610bad83610fa9565b600280546001600160a01b0319166001600160a01b0384161790558015610bfd576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b6104e182826000611048565b60008054604051632376548f60e21b81526001600160a01b0390911690638dd9523c90610c4590879087908790600401611482565b602060405180830381865afa158015610c62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8691906114b9565b949350505050565b638b78c6d819543314610641576382b429006000526004601cfd5b6104e182826001611048565b6000838383604051602001610ccc939291906114fb565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b638b78c6d8600c5233600052806020600c205416610475576382b429006000526004601cfd5b6000816014526370a0823160601b60005260208060246010865afa601f3d111660205102905092915050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af18060016000511416610dca57803d873b151710610dca57637939f4246000526004601cfd5b50600060605260405250505050565b816014528060345263095ea7b360601b60005260206000604460106000875af18060016000511416610e1e57803d853b151710610e1e57633e3f8f736000526004601cfd5b506000603452505050565b60008054604051632376548f60e21b815282916001600160a01b031690638dd9523c90610e5e908a9088908890600401611482565b602060405180830381865afa158015610e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9f91906114b9565b905080471015610ef65760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e73756666696369656e742066756e6473000000000000000060448201526064015b60405180910390fd5b60005460405163c21dda4f60e01b81526001600160a01b039091169063c21dda4f908390610f30908b908b908b908b908b906004016115a8565b6000604051808303818588803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b50939a9950505050505050505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b038116610ff45760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610eed565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c2080548381178361106a575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b6000602082840312156110b357600080fd5b5035919050565b803567ffffffffffffffff811681146110d257600080fd5b919050565b6000602082840312156110e957600080fd5b6110f2826110ba565b9392505050565b80356001600160a01b03811681146110d257600080fd5b6000806040838503121561112357600080fd5b61112c836110f9565b946020939093013593505050565b80356001600160e01b0319811681146110d257600080fd5b60008060006060848603121561116757600080fd5b611170846110f9565b925061117e6020850161113a565b91506040840135801515811461119357600080fd5b809150509250925092565b6000602082840312156111b057600080fd5b6110f2826110f9565b6000608082840312156111cb57600080fd5b50919050565b6000806000606084860312156111e657600080fd5b833592506111f6602085016110ba565b9150604084013567ffffffffffffffff81111561121257600080fd5b61121e868287016111b9565b9150509250925092565b6000806040838503121561123b57600080fd5b611244836110f9565b91506112526020840161113a565b90509250929050565b60008060008060006080868803121561127357600080fd5b85359450611283602087016110ba565b9350604086013567ffffffffffffffff808211156112a057600080fd5b6112ac89838a016111b9565b945060608801359150808211156112c257600080fd5b818801915088601f8301126112d657600080fd5b8135818111156112e557600080fd5b8960206060830285010111156112fa57600080fd5b9699959850939650602001949392505050565b6000806000806080858703121561132357600080fd5b61132c856110f9565b935061133a602086016110f9565b9250611348604086016110f9565b9150611356606086016110f9565b905092959194509250565b6000808335601e1984360301811261137857600080fd5b83018035915067ffffffffffffffff82111561139357600080fd5b6020019150368190038213156113a857600080fd5b9250929050565b6001600160e01b031981358181169160048510156113d75780818660040360031b1b83161692505b505092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b8183823760009101908152919050565b818103818111156104c957634e487b7160e01b600052601160045260246000fd5b6000815180845260005b8181101561146257602081850181015186830182015201611446565b506000602082860101526020601f19601f83011685010191505092915050565b600067ffffffffffffffff8086168352606060208401526114a6606084018661143c565b9150808416604084015250949350505050565b6000602082840312156114cb57600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b838152600067ffffffffffffffff80851660208401526060604084015280611522856110ba565b1660608401526001600160a01b0361153c602086016110f9565b166080840152604084013560a08401526060840135601e1985360301811261156357600080fd5b84016020810190358281111561157857600080fd5b80360382131561158757600080fd5b608060c086015261159c60e0860182846114d2565b98975050505050505050565b600067ffffffffffffffff808816835260ff8716602084015260018060a01b038616604084015260a060608401526115e360a084018661143c565b9150808416608084015250969550505050505056fea2646970667358221220280a7d78d1f344d5819608dd2493959571b5223d952dd71039004bfa2805c7b864736f6c63430008180033", + Bin: "0x60a06040523480156200001157600080fd5b5063ffffffff60643b1615620000975760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156200007f575060408051601f3d908101601f191682019092526200007c9181019062000110565b60015b6200008e57436080526200009c565b6080526200009c565b436080525b620000a6620000ac565b6200012a565b63409feecd1980546001811615620000cc5763f92ee8a96000526004601cfd5b8160c01c808260011c146200010b578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012357600080fd5b5051919050565b60805161162e6200014660003960006103d0015261162e6000f3fe6080604052600436106101405760003560e01c80635ba15647116100b6578063cb01a09a1161006f578063cb01a09a146103ab578063eae4c19f146103be578063f04e283e146103f2578063f2fde38b14610405578063f8c8765e14610418578063fee81cf41461043857600080fd5b80635ba15647146102cc5780635db9cbe4146102ec578063715018a61461031c57806374eeb847146103245780638da5cb5b14610357578063b23ade801461037057600080fd5b80632b370b67116101085780632b370b67146101ef5780632de948071461020f57806339acf9f1146102425780634a4ee7b11461027a578063514e62fc1461028d57806354d1f13d146102c457600080fd5b8063183a4f6e14610145578063188a97aa1461015a5780631c10893f1461018d5780631cd64df4146101a057806325692962146101e7575b600080fd5b6101586101533660046110a1565b61046b565b005b34801561016657600080fd5b5061017a6101753660046110d7565b610478565b6040519081526020015b60405180910390f35b61015861019b366004611110565b6104cf565b3480156101ac57600080fd5b506101d76101bb366004611110565b638b78c6d8600c90815260009290925260209091205481161490565b6040519015158152602001610184565b6101586104e5565b3480156101fb57600080fd5b5061015861020a366004611152565b610535565b34801561021b57600080fd5b5061017a61022a36600461119e565b638b78c6d8600c908152600091909152602090205490565b34801561024e57600080fd5b50600054610262906001600160a01b031681565b6040516001600160a01b039091168152602001610184565b610158610288366004611110565b6105b4565b34801561029957600080fd5b506101d76102a8366004611110565b638b78c6d8600c90815260009290925260209091205416151590565b6101586105c6565b3480156102d857600080fd5b506101d76102e73660046111d1565b610602565b3480156102f857600080fd5b506101d76103073660046110a1565b60046020526000908152604090205460ff1681565b61015861062f565b34801561033057600080fd5b5060005461034590600160a01b900460ff1681565b60405160ff9091168152602001610184565b34801561036357600080fd5b50638b78c6d81954610262565b34801561037c57600080fd5b506101d761038b366004611228565b600360209081526000928352604080842090915290825290205460ff1681565b6101586103b936600461125b565b610643565b3480156103ca57600080fd5b5061017a7f000000000000000000000000000000000000000000000000000000000000000081565b61015861040036600461119e565b610af4565b61015861041336600461119e565b610b31565b34801561042457600080fd5b5061015861043336600461130d565b610b58565b34801561044457600080fd5b5061017a61045336600461119e565b63389a75e1600c908152600091909152602090205490565b6104753382610c04565b50565b6040516000196024820181905260448201526000906104c990839060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052620186a0610c10565b92915050565b6104d7610c8e565b6104e18282610ca9565b5050565b60006202a30067ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b61053d610c8e565b6001600160a01b03831660008181526003602090815260408083206001600160e01b0319871680855290835292819020805460ff191686151590811790915590519081529192917f4a2dc3dabd793cd88cb7b56ba4aa70196892e5b996fc72f4f3d45e20343d305b910160405180910390a3505050565b6105bc610c8e565b6104e18282610c04565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b600060046000610613868686610cb5565b815260208101919091526040016000205460ff16949350505050565b610637610c8e565b6106416000610ceb565b565b600161064e81610d29565b3068929eee149b4bd21268540361066d5763ab143c066000526004601cfd5b3068929eee149b4bd21268554661068760208601866110d7565b67ffffffffffffffff16146106af5760405163fd24301760e01b815260040160405180910390fd5b600360006106c3604087016020880161119e565b6001600160a01b0316815260208101919091526040016000908120906106ec6060870187611361565b6106f5916113af565b6001600160e01b031916815260208101919091526040016000205460ff16610730576040516315dace2d60e21b815260040160405180910390fd5b600061073d878787610cb5565b60008181526004602052604090205490915060ff161561077057604051630c4a31a760e01b815260040160405180910390fd5b6000818152600460205260408120805460ff191660011790558367ffffffffffffffff8111156107a2576107a26113df565b6040519080825280602002602001820160405280156107cb578160200160208202803683370190505b50905060005b8481101561091557610814308787848181106107ef576107ef6113f5565b610805926020606090920201908101915061119e565b6001600160a01b031690610d4f565b828281518110610826576108266113f5565b60200260200101818152505061088c3330888885818110610849576108496113f5565b90506060020160400135898986818110610865576108656113f5565b61087b926020606090920201908101915061119e565b6001600160a01b0316929190610d7b565b61090d8686838181106108a1576108a16113f5565b90506060020160200160208101906108b9919061119e565b8787848181106108cb576108cb6113f5565b905060600201604001358888858181106108e7576108e76113f5565b6108fd926020606090920201908101915061119e565b6001600160a01b03169190610dd9565b6001016107d1565b506000610928604088016020890161119e565b6001600160a01b0316604088013561094360608a018a611361565b60405161095192919061140b565b60006040518083038185875af1925050503d806000811461098e576040519150601f19603f3d011682016040523d82523d6000602084013e610993565b606091505b50509050806109b557604051633204506f60e01b815260040160405180910390fd5b60005b85811015610a16578281815181106109d2576109d26113f5565b60200260200101516109f0308989858181106107ef576107ef6113f5565b14610a0e5760405163903c78cd60e01b815260040160405180910390fd5b6001016109b8565b50604051602481018a90526044810184905260009060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052600254909150600090610a7d908b906004906001600160a01b031685620186a0610e29565b905080610a8e60408b01353461141b565b1015610aac5760405162976f7560e21b815260040160405180910390fd5b604051339086908d907f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89190600090a450505050503868929eee149b4bd2126855505050505050565b610afc610c8e565b63389a75e1600c52806000526020600c208054421115610b2457636f5e88186000526004601cfd5b6000905561047581610ceb565b610b39610c8e565b8060601b610b4f57637448fbae6000526004601cfd5b61047581610ceb565b63409feecd198054600382558015610b8f5760018160011c14303b10610b865763f92ee8a96000526004601cfd5b818160ff1b1b91505b50610b9985610f6d565b610ba4846001610ca9565b610bad83610fa9565b600280546001600160a01b0319166001600160a01b0384161790558015610bfd576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b6104e182826000611048565b60008054604051632376548f60e21b81526001600160a01b0390911690638dd9523c90610c4590879087908790600401611482565b602060405180830381865afa158015610c62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8691906114b9565b949350505050565b638b78c6d819543314610641576382b429006000526004601cfd5b6104e182826001611048565b6000838383604051602001610ccc939291906114fb565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b638b78c6d8600c5233600052806020600c205416610475576382b429006000526004601cfd5b6000816014526370a0823160601b60005260208060246010865afa601f3d111660205102905092915050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af18060016000511416610dca57803d873b151710610dca57637939f4246000526004601cfd5b50600060605260405250505050565b816014528060345263095ea7b360601b60005260206000604460106000875af18060016000511416610e1e57803d853b151710610e1e57633e3f8f736000526004601cfd5b506000603452505050565b60008054604051632376548f60e21b815282916001600160a01b031690638dd9523c90610e5e908a9088908890600401611482565b602060405180830381865afa158015610e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9f91906114b9565b905080471015610ef65760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e73756666696369656e742066756e6473000000000000000060448201526064015b60405180910390fd5b60005460405163c21dda4f60e01b81526001600160a01b039091169063c21dda4f908390610f30908b908b908b908b908b906004016115a8565b6000604051808303818588803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b50939a9950505050505050505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b038116610ff45760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610eed565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c2080548381178361106a575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b6000602082840312156110b357600080fd5b5035919050565b803567ffffffffffffffff811681146110d257600080fd5b919050565b6000602082840312156110e957600080fd5b6110f2826110ba565b9392505050565b80356001600160a01b03811681146110d257600080fd5b6000806040838503121561112357600080fd5b61112c836110f9565b946020939093013593505050565b80356001600160e01b0319811681146110d257600080fd5b60008060006060848603121561116757600080fd5b611170846110f9565b925061117e6020850161113a565b91506040840135801515811461119357600080fd5b809150509250925092565b6000602082840312156111b057600080fd5b6110f2826110f9565b6000608082840312156111cb57600080fd5b50919050565b6000806000606084860312156111e657600080fd5b833592506111f6602085016110ba565b9150604084013567ffffffffffffffff81111561121257600080fd5b61121e868287016111b9565b9150509250925092565b6000806040838503121561123b57600080fd5b611244836110f9565b91506112526020840161113a565b90509250929050565b60008060008060006080868803121561127357600080fd5b85359450611283602087016110ba565b9350604086013567ffffffffffffffff808211156112a057600080fd5b6112ac89838a016111b9565b945060608801359150808211156112c257600080fd5b818801915088601f8301126112d657600080fd5b8135818111156112e557600080fd5b8960206060830285010111156112fa57600080fd5b9699959850939650602001949392505050565b6000806000806080858703121561132357600080fd5b61132c856110f9565b935061133a602086016110f9565b9250611348604086016110f9565b9150611356606086016110f9565b905092959194509250565b6000808335601e1984360301811261137857600080fd5b83018035915067ffffffffffffffff82111561139357600080fd5b6020019150368190038213156113a857600080fd5b9250929050565b6001600160e01b031981358181169160048510156113d75780818660040360031b1b83161692505b505092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b8183823760009101908152919050565b818103818111156104c957634e487b7160e01b600052601160045260246000fd5b6000815180845260005b8181101561146257602081850181015186830182015201611446565b506000602082860101526020601f19601f83011685010191505092915050565b600067ffffffffffffffff8086168352606060208401526114a6606084018661143c565b9150808416604084015250949350505050565b6000602082840312156114cb57600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b838152600067ffffffffffffffff80851660208401526060604084015280611522856110ba565b1660608401526001600160a01b0361153c602086016110f9565b166080840152604084013560a08401526060840135601e1985360301811261156357600080fd5b84016020810190358281111561157857600080fd5b80360382131561158757600080fd5b608060c086015261159c60e0860182846114d2565b98975050505050505050565b600067ffffffffffffffff808816835260ff8716602084015260018060a01b038616604084015260a060608401526115e360a084018661143c565b9150808416608084015250969550505050505056fea2646970667358221220343fd3e114a650411dbb17bacb858e4d22cae9a2a4b33d54250a1468d230414364736f6c63430008180033", } // SolveOutboxABI is the input ABI used to generate the binding from. diff --git a/contracts/solve/.gas-snapshot b/contracts/solve/.gas-snapshot index 37fa7facb..f036a5b5a 100644 --- a/contracts/solve/.gas-snapshot +++ b/contracts/solve/.gas-snapshot @@ -1,33 +1,33 @@ -SolveInbox_accept_Test:test_accept_one_request() (gas: 395276) -SolveInbox_accept_Test:test_accept_reverts() (gas: 1047031) -SolveInbox_accept_Test:test_accept_skip_first() (gas: 703186) -SolveInbox_accept_Test:test_accept_two_requests() (gas: 727312) -SolveInbox_cancel_Test:test_cancel_multiToken() (gas: 548512) -SolveInbox_cancel_Test:test_cancel_nativeMultiToken() (gas: 637552) -SolveInbox_cancel_Test:test_cancel_oldest_request() (gas: 693948) -SolveInbox_cancel_Test:test_cancel_one_request() (gas: 396173) -SolveInbox_cancel_Test:test_cancel_rejected_nativeMultiToken_request() (gas: 647058) -SolveInbox_cancel_Test:test_cancel_rejected_nativeToken_request() (gas: 405192) -SolveInbox_cancel_Test:test_cancel_reverts() (gas: 1068135) -SolveInbox_cancel_Test:test_cancel_singleToken() (gas: 427717) -SolveInbox_cancel_Test:test_cancel_two_requests() (gas: 705726) -SolveInbox_claim_Test:test_claim_multiDeposit() (gas: 719118) -SolveInbox_claim_Test:test_claim_reverts() (gas: 448858) -SolveInbox_claim_Test:test_claim_singleNative() (gas: 471334) -SolveInbox_claim_Test:test_claim_singleToken() (gas: 502256) -SolveInbox_markFulfilled_Test:test_markFulfilled_reverts() (gas: 506937) -SolveInbox_markFulfilled_Test:test_markFulfilled_success() (gas: 417277) -SolveInbox_reject_Test:test_reject_nativeMultiToken() (gas: 601341) -SolveInbox_reject_Test:test_reject_oldest_request() (gas: 666353) -SolveInbox_reject_Test:test_reject_one_request() (gas: 368071) -SolveInbox_reject_Test:test_reject_reverts() (gas: 749056) -SolveInbox_reject_Test:test_reject_two_requests() (gas: 670691) -SolveInbox_request_Test:test_request_multiToken() (gas: 551270) -SolveInbox_request_Test:test_request_nativeMultiToken() (gas: 609471) -SolveInbox_request_Test:test_request_reverts() (gas: 929951) -SolveInbox_request_Test:test_request_singleNative() (gas: 369998) -SolveInbox_request_Test:test_request_singleToken() (gas: 431512) -SolveInbox_request_Test:test_request_two() (gas: 678931) +SolveInbox_accept_Test:test_accept_one_request() (gas: 537030) +SolveInbox_accept_Test:test_accept_reverts() (gas: 1339215) +SolveInbox_accept_Test:test_accept_skip_first() (gas: 902646) +SolveInbox_accept_Test:test_accept_two_requests() (gas: 953825) +SolveInbox_cancel_Test:test_cancel_multiToken() (gas: 688533) +SolveInbox_cancel_Test:test_cancel_nativeMultiToken() (gas: 778693) +SolveInbox_cancel_Test:test_cancel_oldest_request() (gas: 900582) +SolveInbox_cancel_Test:test_cancel_one_request() (gas: 535091) +SolveInbox_cancel_Test:test_cancel_rejected_nativeMultiToken_request() (gas: 860066) +SolveInbox_cancel_Test:test_cancel_rejected_nativeToken_request() (gas: 613808) +SolveInbox_cancel_Test:test_cancel_reverts() (gas: 1384001) +SolveInbox_cancel_Test:test_cancel_singleToken() (gas: 566623) +SolveInbox_cancel_Test:test_cancel_two_requests() (gas: 926513) +SolveInbox_claim_Test:test_claim_multiDeposit() (gas: 963296) +SolveInbox_claim_Test:test_claim_reverts() (gas: 651008) +SolveInbox_claim_Test:test_claim_singleNative() (gas: 713232) +SolveInbox_claim_Test:test_claim_singleToken() (gas: 744158) +SolveInbox_markFulfilled_Test:test_markFulfilled_reverts() (gas: 619200) +SolveInbox_markFulfilled_Test:test_markFulfilled_success() (gas: 605634) +SolveInbox_reject_Test:test_reject_nativeMultiToken() (gas: 742344) +SolveInbox_reject_Test:test_reject_oldest_request() (gas: 872875) +SolveInbox_reject_Test:test_reject_one_request() (gas: 506887) +SolveInbox_reject_Test:test_reject_reverts() (gas: 951608) +SolveInbox_reject_Test:test_reject_two_requests() (gas: 891281) +SolveInbox_request_Test:test_request_multiToken() (gas: 642443) +SolveInbox_request_Test:test_request_nativeMultiToken() (gas: 701762) +SolveInbox_request_Test:test_request_reverts() (gas: 1199281) +SolveInbox_request_Test:test_request_singleNative() (gas: 460051) +SolveInbox_request_Test:test_request_singleToken() (gas: 521569) +SolveInbox_request_Test:test_request_two() (gas: 824884) SolveOutbox_fulfill_test:test_fulfillFee() (gas: 27996) SolveOutbox_fulfill_test:test_fulfill_reverts() (gas: 673377) SolveOutbox_fulfill_test:test_fulfill_succeeds() (gas: 274856) \ No newline at end of file diff --git a/contracts/solve/src/Solve.sol b/contracts/solve/src/Solve.sol index a69ee6a52..b5f03eb62 100644 --- a/contracts/solve/src/Solve.sol +++ b/contracts/solve/src/Solve.sol @@ -15,6 +15,11 @@ library Solve { Claimed } + struct StatusUpdate { + Status status; + uint40 timestamp; + } + /** * @notice Reason for rejecting a request. */ @@ -34,6 +39,7 @@ library Solve { * @param status Request status (open, accepted, cancelled, rejected, fulfilled, paid). * @param call Details of the call to be executed on another chain. * @param deposits Array of deposits backing the request. + * @param updateHistory Array of status updates including timestamps. */ struct Request { bytes32 id; @@ -43,6 +49,7 @@ library Solve { address acceptedBy; Call call; Deposit[] deposits; + StatusUpdate[] updateHistory; } /** diff --git a/contracts/solve/src/SolveInbox.sol b/contracts/solve/src/SolveInbox.sol index cda763f87..993cd197d 100644 --- a/contracts/solve/src/SolveInbox.sol +++ b/contracts/solve/src/SolveInbox.sol @@ -69,11 +69,23 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I */ mapping(bytes32 id => Solve.Request) internal _requests; + /** + * @notice Map status to latest request ID. + */ + mapping(Solve.Status => bytes32 id) internal _latestReqByStatus; + constructor() { // Must get Arbitrum block number from ArbSys precompile, block.number returns L1 block number on Arbitrum. - // This is a temporary fix, we need a robust way of properly setting this value when on any Arbitrum chain. - if (block.chainid != 42_161 && block.chainid != 421_614) deployedAt = block.number; - else deployedAt = IArbSys(ARB_SYS).arbBlockNumber(); + if (_isContract(ARB_SYS)) { + try IArbSys(ARB_SYS).arbBlockNumber() returns (uint256 arbBlockNumber) { + deployedAt = arbBlockNumber; + } catch { + deployedAt = block.number; + } + } else { + deployedAt = block.number; + } + _disableInitializers(); } @@ -97,6 +109,20 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I return _requests[id]; } + /** + * @notice Returns the update history for the request with the given ID. + */ + function getRequestUpdateHistory(bytes32 id) external view returns (Solve.StatusUpdate[] memory) { + return _requests[id].updateHistory; + } + + /** + * @notice Returns the latest request with the given status. + */ + function getLatestRequestByStatus(Solve.Status status) external view returns (Solve.Request memory) { + return _requests[_latestReqByStatus[status]]; + } + /** * @notice Open a request to execute a call on another chain, backed by deposits. * Token deposits are transferred from msg.sender to this inbox. @@ -130,9 +156,15 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I Solve.Request storage req = _requests[id]; if (req.status != Solve.Status.Pending) revert NotPending(); - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Accepted; + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Accepted, timestamp: uint40(block.timestamp) }); + + req.updatedAt = update.timestamp; + req.status = update.status; req.acceptedBy = msg.sender; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Accepted] = id; emit Accepted(id, msg.sender); } @@ -146,8 +178,14 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I Solve.Request storage req = _requests[id]; if (req.status != Solve.Status.Pending) revert NotPending(); - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Rejected; + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Rejected, timestamp: uint40(block.timestamp) }); + + req.updatedAt = update.timestamp; + req.status = update.status; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Rejected] = id; emit Rejected(id, msg.sender, reason); } @@ -162,8 +200,14 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I if (req.status != Solve.Status.Pending && req.status != Solve.Status.Rejected) revert NotPendingOrRejected(); if (req.from != msg.sender) revert Unauthorized(); - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Reverted; + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Reverted, timestamp: uint40(block.timestamp) }); + + req.updatedAt = update.timestamp; + req.status = update.status; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Reverted] = id; _transferDeposits(req.from, req.deposits); @@ -183,8 +227,14 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I // Ensure reported call hash matches requested call hash if (callHash != _callHash(id, uint64(block.chainid), req.call)) revert WrongCallHash(); - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Fulfilled; + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Fulfilled, timestamp: uint40(block.timestamp) }); + + req.updatedAt = update.timestamp; + req.status = update.status; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Fulfilled] = id; emit Fulfilled(id, callHash, req.acceptedBy); } @@ -199,8 +249,14 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I if (req.status != Solve.Status.Fulfilled) revert NotFulfilled(); if (req.acceptedBy != msg.sender) revert Unauthorized(); - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Claimed; + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Claimed, timestamp: uint40(block.timestamp) }); + + req.updatedAt = update.timestamp; + req.status = update.status; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Claimed] = id; _transferDeposits(to, req.deposits); @@ -234,12 +290,18 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I { bytes32 id = _nextId(); + Solve.StatusUpdate memory update = + Solve.StatusUpdate({ status: Solve.Status.Pending, timestamp: uint40(block.timestamp) }); + req = _requests[id]; req.id = id; - req.updatedAt = uint40(block.timestamp); - req.status = Solve.Status.Pending; + req.updatedAt = update.timestamp; + req.status = update.status; req.from = from; req.call = call; + req.updateHistory.push(update); + + _latestReqByStatus[Solve.Status.Pending] = id; if (msg.value > 0) { req.deposits.push(Solve.Deposit({ isNative: true, token: address(0), amount: msg.value })); @@ -271,4 +333,15 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I function _callHash(bytes32 id, uint64 sourceChainId, Solve.Call storage call) internal pure returns (bytes32) { return keccak256(abi.encode(id, sourceChainId, call)); } + + /** + * @dev Returns true if the address is a contract. + */ + function _isContract(address addr) internal view returns (bool) { + uint32 size; + assembly { + size := extcodesize(addr) + } + return (size > 0); + } } diff --git a/contracts/solve/src/SolveOutbox.sol b/contracts/solve/src/SolveOutbox.sol index fc64ec063..9827b8323 100644 --- a/contracts/solve/src/SolveOutbox.sol +++ b/contracts/solve/src/SolveOutbox.sol @@ -85,9 +85,16 @@ contract SolveOutbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase { constructor() { // Must get Arbitrum block number from ArbSys precompile, block.number returns L1 block number on Arbitrum. - // This is a temporary fix, we need a robust way of properly setting this value when on any Arbitrum chain. - if (block.chainid != 42_161 && block.chainid != 421_614) deployedAt = block.number; - else deployedAt = IArbSys(ARB_SYS).arbBlockNumber(); + if (_isContract(ARB_SYS)) { + try IArbSys(ARB_SYS).arbBlockNumber() returns (uint256 arbBlockNumber) { + deployedAt = arbBlockNumber; + } catch { + deployedAt = block.number; + } + } else { + deployedAt = block.number; + } + _disableInitializers(); } @@ -185,4 +192,15 @@ contract SolveOutbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase { function _callHash(bytes32 srcReqId, uint64 srcChainId, Solve.Call calldata call) internal pure returns (bytes32) { return keccak256(abi.encode(srcReqId, srcChainId, call)); } + + /** + * @dev Returns true if the address is a contract. + */ + function _isContract(address addr) internal view returns (bool) { + uint32 size; + assembly { + size := extcodesize(addr) + } + return (size > 0); + } } diff --git a/contracts/solve/src/interfaces/ISolveInbox.sol b/contracts/solve/src/interfaces/ISolveInbox.sol index 50c078df6..8115a1c4c 100644 --- a/contracts/solve/src/interfaces/ISolveInbox.sol +++ b/contracts/solve/src/interfaces/ISolveInbox.sol @@ -56,6 +56,16 @@ interface ISolveInbox { */ function getRequest(bytes32 id) external view returns (Solve.Request memory); + /** + * @notice Returns the update history for the request with the given ID. + */ + function getRequestUpdateHistory(bytes32 id) external view returns (Solve.StatusUpdate[] memory); + + /** + * @notice Returns the latest request with the given status. + */ + function getLatestRequestByStatus(Solve.Status status) external view returns (Solve.Request memory); + /** * @notice Open a request to execute a call on another chain, backed by deposits. * Token deposits are transferred from msg.sender to this inbox. diff --git a/contracts/solve/test/Inbox_accept.t.sol b/contracts/solve/test/Inbox_accept.t.sol index 4efee0968..064a61235 100644 --- a/contracts/solve/test/Inbox_accept.t.sol +++ b/contracts/solve/test/Inbox_accept.t.sol @@ -81,6 +81,17 @@ contract SolveInbox_accept_Test is InboxBase { assertEq(inbox.getRequest(id).acceptedBy, solver, "inbox.getRequest(id).acceptedBy"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Accepted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Accepted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Accepted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Accepted), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } /// @dev Test accepting two requests @@ -104,6 +115,23 @@ contract SolveInbox_accept_Test is InboxBase { assertEq(inbox.getRequest(id2).acceptedBy, solver, "inbox.getRequest(id2).acceptedBy"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Accepted), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Accepted), "inbox.getRequest(id2).status"); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Accepted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Accepted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[1].status), + uint8(Solve.Status.Accepted), + "inbox.getRequestUpdateHistory(id1)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[1].status), + uint8(Solve.Status.Accepted), + "inbox.getRequestUpdateHistory(id2)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 2, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 2, "inbox.getRequestUpdateHistory(id2).length"); } /// @dev Test accepting requests out of order @@ -126,5 +154,22 @@ contract SolveInbox_accept_Test is InboxBase { assertEq(inbox.getRequest(id2).acceptedBy, solver, "inbox.getRequest(id2).acceptedBy"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Pending), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Accepted), "inbox.getRequest(id2).status"); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Accepted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Accepted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[0].status), + uint8(Solve.Status.Pending), + "inbox.getRequestUpdateHistory(id1)[0].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[1].status), + uint8(Solve.Status.Accepted), + "inbox.getRequestUpdateHistory(id2)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 1, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 2, "inbox.getRequestUpdateHistory(id2).length"); } } diff --git a/contracts/solve/test/Inbox_cancel.t.sol b/contracts/solve/test/Inbox_cancel.t.sol index 353ff133f..6bf377ddd 100644 --- a/contracts/solve/test/Inbox_cancel.t.sol +++ b/contracts/solve/test/Inbox_cancel.t.sol @@ -75,6 +75,17 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(address(inbox).balance, 0, "address(inbox).balance"); assertEq(address(user).balance, 1 ether, "address(user).balance"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } function test_cancel_two_requests() public { @@ -97,6 +108,23 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(address(user).balance, 2 ether, "address(user).balance"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id2).status"); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id1)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id2)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 2, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 2, "inbox.getRequestUpdateHistory(id2).length"); } function test_cancel_oldest_request() public { @@ -117,6 +145,28 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(address(user).balance, 1 ether, "address(user).balance"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Pending), "inbox.getRequest(id2).status"); + assertEq( + id1, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id1)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[0].status), + uint8(Solve.Status.Pending), + "inbox.getRequestUpdateHistory(id2)[0].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 2, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 1, "inbox.getRequestUpdateHistory(id2).length"); } function test_cancel_singleToken() public { @@ -136,6 +186,17 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(token1.balanceOf(address(inbox)), 0, "token1.balanceOf(inbox)"); assertEq(token1.balanceOf(user), 1 ether, "token1.balanceOf(user)"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } function test_cancel_multiToken() public { @@ -158,6 +219,17 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(token1.balanceOf(user), 1 ether, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 1 ether, "token2.balanceOf(user)"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } function test_cancel_nativeMultiToken() public { @@ -183,6 +255,17 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(token1.balanceOf(user), 1 ether, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 1 ether, "token2.balanceOf(user)"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } function test_cancel_rejected_nativeToken_request() public { @@ -204,6 +287,27 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(address(inbox).balance, 0, "address(inbox).balance"); assertEq(address(user).balance, 1 ether, "address(user).balance"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[2].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[2].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 3, "inbox.getRequestUpdateHistory(id).length"); } function test_cancel_rejected_nativeMultiToken_request() public { @@ -233,5 +337,26 @@ contract SolveInbox_cancel_Test is InboxBase { assertEq(token1.balanceOf(user), 1 ether, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 1 ether, "token2.balanceOf(user)"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Reverted), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Reverted).id, + "inbox.getLatestRequestByStatus(Solve.Status.Reverted)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[2].status), + uint8(Solve.Status.Reverted), + "inbox.getRequestUpdateHistory(id)[2].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 3, "inbox.getRequestUpdateHistory(id).length"); } } diff --git a/contracts/solve/test/Inbox_claim.t.sol b/contracts/solve/test/Inbox_claim.t.sol index 3818920e3..3c3c9c401 100644 --- a/contracts/solve/test/Inbox_claim.t.sol +++ b/contracts/solve/test/Inbox_claim.t.sol @@ -72,6 +72,17 @@ contract SolveInbox_claim_Test is InboxBase { Solve.Request memory req = inbox.getRequest(id); assertEq(uint8(req.status), uint8(Solve.Status.Claimed), "req.status"); assertEq(claimTo.balance, 1 ether, "claimTo.balance"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Claimed).id, + "inbox.getLatestRequestByStatus(Solve.Status.Claimed)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[3].status), + uint8(Solve.Status.Claimed), + "inbox.getRequestUpdateHistory(id)[3].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 4, "inbox.getRequestUpdateHistory(id).length"); } function test_claim_singleToken() public { @@ -91,6 +102,17 @@ contract SolveInbox_claim_Test is InboxBase { Solve.Request memory req = inbox.getRequest(id); assertEq(uint8(req.status), uint8(Solve.Status.Claimed), "req.status"); assertEq(token1.balanceOf(claimTo), 1 ether, "token.balanceOf(claimTo)"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Claimed).id, + "inbox.getLatestRequestByStatus(Solve.Status.Claimed)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[3].status), + uint8(Solve.Status.Claimed), + "inbox.getRequestUpdateHistory(id)[3].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 4, "inbox.getRequestUpdateHistory(id).length"); } function test_claim_multiDeposit() public { @@ -113,6 +135,17 @@ contract SolveInbox_claim_Test is InboxBase { assertEq(claimTo.balance, 3 ether, "claimTo.balance"); assertEq(token1.balanceOf(claimTo), 1 ether, "token1.balanceOf(claimTo)"); assertEq(token2.balanceOf(claimTo), 2 ether, "token2.balanceOf(claimTo)"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Claimed).id, + "inbox.getLatestRequestByStatus(Solve.Status.Claimed)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[3].status), + uint8(Solve.Status.Claimed), + "inbox.getRequestUpdateHistory(id)[3].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 4, "inbox.getRequestUpdateHistory(id).length"); } /// @dev Open a request, accept it, mark it as fulfilled, and return the request ID. diff --git a/contracts/solve/test/Inbox_markFulfilled.t.sol b/contracts/solve/test/Inbox_markFulfilled.t.sol index 36904744b..f93fc0c14 100644 --- a/contracts/solve/test/Inbox_markFulfilled.t.sol +++ b/contracts/solve/test/Inbox_markFulfilled.t.sol @@ -81,5 +81,16 @@ contract SolveInbox_markFulfilled_Test is InboxBase { Solve.Request memory req = inbox.getRequest(id); assertEq(uint8(req.status), uint8(Solve.Status.Fulfilled), "req.status"); assertEq(req.updatedAt, block.timestamp, "req.updatedAt"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Fulfilled).id, + "inbox.getLatestRequestByStatus(Solve.Status.Fulfilled)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[2].status), + uint8(Solve.Status.Fulfilled), + "inbox.getRequestUpdateHistory(id)[2].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 3, "inbox.getRequestUpdateHistory(id).length"); } } diff --git a/contracts/solve/test/Inbox_reject.t.sol b/contracts/solve/test/Inbox_reject.t.sol index 9a220ee17..9f36f146a 100644 --- a/contracts/solve/test/Inbox_reject.t.sol +++ b/contracts/solve/test/Inbox_reject.t.sol @@ -63,6 +63,17 @@ contract SolveInbox_reject_Test is InboxBase { assertEq(address(inbox).balance, 1 ether, "address(inbox).balance"); assertEq(address(user).balance, 0, "address(user).balance"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Rejected), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } function test_reject_two_requests() public { @@ -85,6 +96,23 @@ contract SolveInbox_reject_Test is InboxBase { assertEq(address(user).balance, 0, "address(user).balance"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Rejected), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Rejected), "inbox.getRequest(id2).status"); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id1)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id2)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 2, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 2, "inbox.getRequestUpdateHistory(id2).length"); } function test_reject_oldest_request() public { @@ -106,6 +134,28 @@ contract SolveInbox_reject_Test is InboxBase { assertEq(address(user).balance, 0, "address(user).balance"); assertEq(uint8(inbox.getRequest(id1).status), uint8(Solve.Status.Rejected), "inbox.getRequest(id1).status"); assertEq(uint8(inbox.getRequest(id2).status), uint8(Solve.Status.Pending), "inbox.getRequest(id2).status"); + assertEq( + id1, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id1)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id1)[1].status" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id2)[0].status), + uint8(Solve.Status.Pending), + "inbox.getRequestUpdateHistory(id2)[0].status" + ); + assertEq(inbox.getRequestUpdateHistory(id1).length, 2, "inbox.getRequestUpdateHistory(id1).length"); + assertEq(inbox.getRequestUpdateHistory(id2).length, 1, "inbox.getRequestUpdateHistory(id2).length"); } function test_reject_nativeMultiToken() public { @@ -131,5 +181,16 @@ contract SolveInbox_reject_Test is InboxBase { assertEq(token1.balanceOf(user), 0, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 0, "token2.balanceOf(user)"); assertEq(uint8(inbox.getRequest(id).status), uint8(Solve.Status.Rejected), "inbox.getRequest(id).status"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Rejected).id, + "inbox.getLatestRequestByStatus(Solve.Status.Rejected)" + ); + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[1].status), + uint8(Solve.Status.Rejected), + "inbox.getRequestUpdateHistory(id)[1].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 2, "inbox.getRequestUpdateHistory(id).length"); } } diff --git a/contracts/solve/test/Inbox_request.t.sol b/contracts/solve/test/Inbox_request.t.sol index c7b96f44a..75a851d9b 100644 --- a/contracts/solve/test/Inbox_request.t.sol +++ b/contracts/solve/test/Inbox_request.t.sol @@ -66,6 +66,11 @@ contract SolveInbox_request_Test is InboxBase { bytes32 id = inbox.request(call, deposits); assertEq(token1.balanceOf(address(inbox)), deposits[0].amount, "token1.balanceOf(inbox)"); assertEq(token1.balanceOf(user), 0, "token1.balanceOf(user)"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); assertNewRequest({ id: id, @@ -92,6 +97,11 @@ contract SolveInbox_request_Test is InboxBase { assertEq(token2.balanceOf(address(inbox)), deposits[1].amount, "token2.balanceOf(inbox)"); assertEq(token1.balanceOf(user), 0, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 0, "token2.balanceOf(user)"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); assertNewRequest({ id: id, @@ -112,6 +122,11 @@ contract SolveInbox_request_Test is InboxBase { bytes32 id = inbox.request{ value: 1 ether }(call, deposits); assertEq(address(inbox).balance, 1 ether, "inbox.balance"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); assertNewRequest({ id: id, @@ -141,6 +156,11 @@ contract SolveInbox_request_Test is InboxBase { assertEq(token2.balanceOf(address(inbox)), deposits[1].amount, "token2.balanceOf(inbox)"); assertEq(token1.balanceOf(user), 0, "token1.balanceOf(user)"); assertEq(token2.balanceOf(user), 0, "token2.balanceOf(user)"); + assertEq( + id, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); assertNewRequest({ id: id, @@ -163,6 +183,12 @@ contract SolveInbox_request_Test is InboxBase { bytes32 id2 = inbox.request{ value: 2 ether }(call, deposits); assertEq(address(inbox).balance, 3 ether, "address(inbox).balance"); + assertEq( + id2, + inbox.getLatestRequestByStatus(Solve.Status.Pending).id, + "inbox.getLatestRequestByStatus(Solve.Status.Pending)" + ); + assertNewRequest({ id: id1, from: user, @@ -220,5 +246,12 @@ contract SolveInbox_request_Test is InboxBase { assertEq(req.deposits[i].token, deposits[i - start].token, "_assertNewRequest : req.deposits[i].token"); assertEq(req.deposits[i].amount, deposits[i - start].amount, "_assertNewRequest : req.deposits[i].amount"); } + + assertEq( + uint8(inbox.getRequestUpdateHistory(id)[0].status), + uint8(Solve.Status.Pending), + "inbox.getRequestUpdateHistory(id)[0].status" + ); + assertEq(inbox.getRequestUpdateHistory(id).length, 1, "inbox.getRequestUpdateHistory(id).length"); } }