diff --git a/contracts/bindings/solveinbox.go b/contracts/bindings/solveinbox.go index f86c22dff..3c2696777 100644 --- a/contracts/bindings/solveinbox.go +++ b/contracts/bindings/solveinbox.go @@ -63,8 +63,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\"}]}]}],\"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: "0x60a06040523480156200001157600080fd5b5063ffffffff60643b1615620000975760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156200007f575060408051601f3d908101601f191682019092526200007c9181019062000110565b60015b6200008e57436080526200009c565b6080526200009c565b436080525b620000a6620000ac565b6200012a565b63409feecd1980546001811615620000cc5763f92ee8a96000526004601cfd5b8160c01c808260011c146200010b578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012357600080fd5b5051919050565b60805161237b6200014660003960006103f8015261237b6000f3fe6080604052600436106101665760003560e01c80637667fd69116100d1578063e4725ba11161008a578063f2fde38b11610064578063f2fde38b1461042d578063f8c8765e14610440578063fb1e61ca14610460578063fee81cf41461048057600080fd5b8063e4725ba1146103c6578063eae4c19f146103e6578063f04e283e1461041a57600080fd5b80637667fd691461030d5780638da5cb5b1461033a57806396c144f014610353578063c4d252f514610373578063db3ea55314610393578063e17771c8146103b357600080fd5b806339acf9f11161012357806339acf9f1146102485780634a4ee7b114610280578063514e62fc1461029357806354d1f13d146102ca578063715018a6146102d257806374eeb847146102da57600080fd5b8063183a4f6e1461016b5780631c10893f146101805780631cd64df41461019357806325692962146101df5780632de94807146101e7578063337ffe2014610228575b600080fd5b61017e610179366004611ad2565b6104b3565b005b61017e61018e366004611b00565b6104c0565b34801561019f57600080fd5b506101ca6101ae366004611b00565b638b78c6d8600c90815260009290925260209091205481161490565b60405190151581526020015b60405180910390f35b61017e6104d6565b3480156101f357600080fd5b5061021a610202366004611b2c565b638b78c6d8600c908152600091909152602090205490565b6040519081526020016101d6565b34801561023457600080fd5b5061017e610243366004611b50565b610525565b34801561025457600080fd5b50600054610268906001600160a01b031681565b6040516001600160a01b0390911681526020016101d6565b61017e61028e366004611b00565b61078f565b34801561029f57600080fd5b506101ca6102ae366004611b00565b638b78c6d8600c90815260009290925260209091205416151590565b61017e6107a1565b61017e6107dd565b3480156102e657600080fd5b506000546102fb90600160a01b900460ff1681565b60405160ff90911681526020016101d6565b34801561031957600080fd5b5061032d610328366004611b72565b6107f1565b6040516101d69190611c88565b34801561034657600080fd5b50638b78c6d81954610268565b34801561035f57600080fd5b5061017e61036e366004611d40565b610a30565b34801561037f57600080fd5b5061017e61038e366004611ad2565b610c12565b34801561039f57600080fd5b5061017e6103ae366004611d70565b610e07565b61021a6103c1366004611d99565b610f2e565b3480156103d257600080fd5b5061017e6103e1366004611ad2565b6110a2565b3480156103f257600080fd5b5061021a7f000000000000000000000000000000000000000000000000000000000000000081565b61017e610428366004611b2c565b6111cb565b61017e61043b366004611b2c565b611208565b34801561044c57600080fd5b5061017e61045b366004611e3a565b61122f565b34801561046c57600080fd5b5061032d61047b366004611ad2565b6112db565b34801561048c57600080fd5b5061021a61049b366004611b2c565b63389a75e1600c908152600091909152602090205490565b6104bd3382611337565b50565b6104c8611343565b6104d2828261135e565b5050565b60006202a3006001600160401b03164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b60005460408051631799380760e11b815281516001600160a01b0390931692632f32700e926004808401939192918290030181865afa15801561056c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105909190611ec1565b8051600180546020909301516001600160a01b0316600160401b026001600160e01b03199093166001600160401b039092169190911791909117905568929eee149b4bd21268543090036105ec5763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060026001820154600160281b900460ff16600681111561062857610628611b93565b146106465760405163029d79a560e41b815260040160405180910390fd5b600354600154600160401b90046001600160a01b0390811691161461067e5760405163bda8fc9560e01b815260040160405180910390fd5b60038101546001546001600160401b039081169116146106b157604051633687f39960e21b815260040160405180910390fd5b6106bf83468360030161136a565b82146106de57604051631c6060ab60e11b815260040160405180910390fd5b60018101805464ffffffffff421665ffffffffffff199091161765050000000000179055600560008181526020919091527f458b30c2d72bfd2c6317304a4594ecbafe5f729d3111b65fdc3a33bd48e5432d84905560028201546040516001600160a01b0390911691849186917f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89191a450503868929eee149b4bd212685550600180546001600160e01b0319169055565b610797611343565b6104d28282611337565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b6107e5611343565b6107ef60006113a0565b565b6107f9611a48565b600460006005600085600681111561081357610813611b93565b600681111561082457610824611b93565b81526020808201929092526040908101600090812054845283830194909452918201909220815160e08101835281548152600182015464ffffffffff811694820194909452929091830190600160281b900460ff16600681111561088a5761088a611b93565b600681111561089b5761089b611b93565b815260018201546001600160a01b03600160301b90910481166020808401919091526002840154821660408085019190915280516080810182526003860180546001600160401b0381168352600160401b9004909416928101929092526004850154908201526005840180546060948501949293928401919061091d90611f1f565b80601f016020809104026020016040519081016040528092919081815260200182805461094990611f1f565b80156109965780601f1061096b57610100808354040283529160200191610996565b820191906000526020600020905b81548152906001019060200180831161097957829003601f168201915b505050505081525050815260200160068201805480602002602001604051908101604052809291908181526020016000905b82821015610a225760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b0316838501526001908101549183019190915290835290920191016109c8565b505050915250909392505050565b3068929eee149b4bd212685403610a4f5763ab143c066000526004601cfd5b3068929eee149b4bd2126855600082815260046020526040902060056001820154600160281b900460ff166006811115610a8b57610a8b611b93565b14610aa9576040516303de361f60e11b815260040160405180910390fd5b60028101546001600160a01b03163314610ad5576040516282b42960e81b815260040160405180910390fd5b60018101805464ffffffffff421665ffffffffffff19909116176506000000000017905560066000818152600560209081527f069400f22b28c6c362558d92f66163cec5671cba50b61abd2eecfcd0eaeac51886905591830180546040805182860281018601909152818152610bb2948794919392919084015b82821015610ba95760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101610b4f565b505050506113de565b816001600160a01b0316336001600160a01b0316847f1291cec4ea55732527f1ae8ff3e53def0dbe1feb99c094983449e59cdce4674b84600601604051610bf99190611fb2565b60405180910390a4503868929eee149b4bd21268555050565b3068929eee149b4bd212685403610c315763ab143c066000526004601cfd5b3068929eee149b4bd21268556000818152600460205260409020600180820154600160281b900460ff166006811115610c6c57610c6c611b93565b14158015610c9a575060036001820154600160281b900460ff166006811115610c9757610c97611b93565b14155b15610cb857604051631fa4148760e21b815260040160405180910390fd5b6001810154600160301b90046001600160a01b03163314610ceb576040516282b42960e81b815260040160405180910390fd5b6001810180546504000000000065ffffffffffff199091164264ffffffffff161717815560046000908152600560209081527f3eec716f11ba9e820c81ca75eb978ffb45831ef8b7a53e5e422c26008e1ca6d585905591546006840180546040805182870281018701909152818152610dcc95600160301b9094046001600160a01b031694909384018215610ba95760008481526020908190206040805160608101825260028602909201805460ff81161515845261010090046001600160a01b031683850152600190810154918301919091529083529092019101610b4f565b60405182907fb66b13449e4bb2c30749a37f3081f1988fcee5ff5d98ce740b354d4e2d94409590600090a2503868929eee149b4bd212685550565b6001610e1281611530565b3068929eee149b4bd212685403610e315763ab143c066000526004601cfd5b3068929eee149b4bd21268556000838152600460205260409020600180820154600160281b900460ff166006811115610e6c57610e6c611b93565b14610e8a57604051633ee3282d60e11b815260040160405180910390fd5b60018101805464ffffffffff421665ffffffffffff1990911617650300000000001790556003600081905260056020527fa9bc9a3a348c357ba16b37005d7e6b3236198c0e939f4af8c5f19b8deeb8ebc08590558390811115610eef57610eef611b93565b604051339086907f21f84ee3a6e9bc7c10f855f8c9829e22c613861cef10add09eccdbc88df9f59f90600090a4503868929eee149b4bd2126855505050565b60003068929eee149b4bd212685403610f4f5763ab143c066000526004601cfd5b3068929eee149b4bd21268556000610f6d6040860160208701611b2c565b6001600160a01b031603610f945760405163574b16a760e11b815260040160405180910390fd5b610fa16020850185611fc5565b6001600160401b0316600003610fca5760405163574b16a760e11b815260040160405180910390fd5b610fd76060850185611fe2565b9050600003610ff95760405163574b16a760e11b815260040160405180910390fd5b81158015611005575034155b1561102357604051630558800760e21b815260040160405180910390fd5b600061103133868686611556565b60018101548154604051929350600160301b9091046001600160a01b0316917f3622a563ce1f96b477fa827bf0b60be8aee346b515754f3645f4d7a2ef5d4b299061108590600386019060068701906120f4565b60405180910390a3543868929eee149b4bd2126855949350505050565b60016110ad81611530565b3068929eee149b4bd2126854036110cc5763ab143c066000526004601cfd5b3068929eee149b4bd21268556000828152600460205260409020600180820154600160281b900460ff16600681111561110757611107611b93565b1461112557604051633ee3282d60e11b815260040160405180910390fd5b60018101805464ffffffffff421665ffffffffffff199091161765020000000000179055600280820180546001600160a01b03191633908117909155600091825260056020527f89832631fb3c3307a103ba2c84ab569c64d6182a18893dcd163f0f1c2090733a859055604051909185917f9deed34441ca75bb2dbbe101d2201930f40e18a9ce521c77fbdca6690a8999679190a3503868929eee149b4bd21268555050565b6111d3611343565b63389a75e1600c52806000526020600c2080544211156111fb57636f5e88186000526004601cfd5b600090556104bd816113a0565b611210611343565b8060601b61122657637448fbae6000526004601cfd5b6104bd816113a0565b63409feecd1980546003825580156112665760018160011c14303b1061125d5763f92ee8a96000526004601cfd5b818160ff1b1b91505b5061127085611844565b61127b84600161135e565b61128483611880565b600380546001600160a01b0319166001600160a01b03841617905580156112d4576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b6112e3611a48565b600082815260046020908152604091829020825160e08101845281548152600182015464ffffffffff81169382019390935292909190830190600160281b900460ff16600681111561088a5761088a611b93565b6104d282826000611923565b638b78c6d8195433146107ef576382b429006000526004601cfd5b6104d282826001611923565b600083838360405160200161138193929190612119565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b6001600160a01b03821661140557604051634e46966960e11b815260040160405180910390fd5b60005b815181101561152b5781818151811061142357611423612141565b602002602001015160000151156114cb576000836001600160a01b031683838151811061145257611452612141565b60200260200101516040015160405160006040518083038185875af1925050503d806000811461149e576040519150601f19603f3d011682016040523d82523d6000602084013e6114a3565b606091505b50509050806114c5576040516312171d8360e31b815260040160405180910390fd5b50611523565b611523838383815181106114e1576114e1612141565b6020026020010151604001518484815181106114ff576114ff612141565b6020026020010151602001516001600160a01b031661197c9092919063ffffffff16565b600101611408565b505050565b638b78c6d8600c5233600052806020600c2054166104bd576382b429006000526004601cfd5b6000806115616119cc565b600081815260046020526040902081815560018101805464ffffffffff421665ffffffffffff1990911617600160281b176601000000000000600160d01b031916600160301b6001600160a01b038b16021790559250905084600383016115c88282612266565b5050600160005260056020527f1471eb6eb2c5e789fc3de43f8ce62938c7d1836ec861730447e2ada8fd81017b819055341561167757604080516060810182526001808252600060208084018281523495850195865260068801805480860182559084529190922093516002909102909301805491516001600160a81b0319909216931515610100600160a81b031916939093176101006001600160a01b039092169190910217825591519101555b60005b8381101561183a5784848281811061169457611694612141565b905060400201602001356000036116be57604051635972996f60e11b815260040160405180910390fd5b60008585838181106116d2576116d2612141565b6116e89260206040909202019081019150611b2c565b6001600160a01b03160361170f57604051635972996f60e11b815260040160405180910390fd5b82600601604051806060016040528060001515815260200187878581811061173957611739612141565b61174f9260206040909202019081019150611b2c565b6001600160a01b0316815260200187878581811061176f5761176f612141565b60206040918202939093018301359093525083546001818101865560009586529482902084516002909202018054928501516001600160a01b031661010002610100600160a81b0319921515929092166001600160a81b03199093169290921717815591015191015561183233308787858181106117ef576117ef612141565b9050604002016020013588888681811061180b5761180b612141565b6118219260206040909202019081019150611b2c565b6001600160a01b03169291906119ea565b60010161167a565b5050949350505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b0381166118cf5760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b604482015260640160405180910390fd5b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c20805483811783611945575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b816014528060345263a9059cbb60601b60005260206000604460106000875af180600160005114166119c157803d853b1517106119c1576390b8ec186000526004601cfd5b506000603452505050565b60028054600091826119dd8361231e565b9091555050600254919050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af18060016000511416611a3957803d873b151710611a3957637939f4246000526004601cfd5b50600060605260405250505050565b6040805160e0810182526000808252602082018190529091820190815260200160006001600160a01b0316815260200160006001600160a01b03168152602001611ac5604051806080016040528060006001600160401b0316815260200160006001600160a01b0316815260200160008152602001606081525090565b8152602001606081525090565b600060208284031215611ae457600080fd5b5035919050565b6001600160a01b03811681146104bd57600080fd5b60008060408385031215611b1357600080fd5b8235611b1e81611aeb565b946020939093013593505050565b600060208284031215611b3e57600080fd5b8135611b4981611aeb565b9392505050565b60008060408385031215611b6357600080fd5b50508035926020909101359150565b600060208284031215611b8457600080fd5b813560078110611b4957600080fd5b634e487b7160e01b600052602160045260246000fd5b6001600160401b0381511682526000602060018060a01b03602084015116602085015260408301516040850152606083015160806060860152805180608087015260005b81811015611c095782810184015187820160a001528301611bed565b50600060a0828801015260a0601f19601f830116870101935050505092915050565b60008151808452602080850194506020840160005b83811015611c7d578151805115158852838101516001600160a01b0316848901526040908101519088015260609096019590820190600101611c40565b509495945050505050565b602081528151602082015264ffffffffff60208301511660408201526000604083015160078110611cc957634e487b7160e01b600052602160045260246000fd5b806060840152506060830151611cea60808401826001600160a01b03169052565b5060808301516001600160a01b03811660a08401525060a083015160e060c0840152611d1a610100840182611ba9565b905060c0840151601f198483030160e0850152611d378282611c2b565b95945050505050565b60008060408385031215611d5357600080fd5b823591506020830135611d6581611aeb565b809150509250929050565b60008060408385031215611d8357600080fd5b82359150602083013560048110611d6557600080fd5b600080600060408486031215611dae57600080fd5b83356001600160401b0380821115611dc557600080fd5b9085019060808288031215611dd957600080fd5b90935060208501359080821115611def57600080fd5b818601915086601f830112611e0357600080fd5b813581811115611e1257600080fd5b8760208260061b8501011115611e2757600080fd5b6020830194508093505050509250925092565b60008060008060808587031215611e5057600080fd5b8435611e5b81611aeb565b93506020850135611e6b81611aeb565b92506040850135611e7b81611aeb565b91506060850135611e8b81611aeb565b939692955090935050565b634e487b7160e01b600052604160045260246000fd5b6001600160401b03811681146104bd57600080fd5b600060408284031215611ed357600080fd5b604051604081018181106001600160401b0382111715611ef557611ef5611e96565b6040528251611f0381611eac565b81526020830151611f1381611aeb565b60208201529392505050565b600181811c90821680611f3357607f821691505b602082108103611f5357634e487b7160e01b600052602260045260246000fd5b50919050565b600081548084526020808501945083600052602060002060005b83811015611c7d57815460ff81161515885260081c6001600160a01b031683880152600180830154604089015260609097019660029092019101611f73565b602081526000611b496020830184611f59565b600060208284031215611fd757600080fd5b8135611b4981611eac565b6000808335601e19843603018112611ff957600080fd5b8301803591506001600160401b0382111561201357600080fd5b60200191503681900382131561202857600080fd5b9250929050565b600081546001600160401b0381168452602060018060a01b038260401c166020860152600191506001840154604086015260028401608060608701526000815461207881611f1f565b8060808a015260a0600183166000811461209957600181146120b5576120e5565b60ff19841660a08c015260a083151560051b8c010194506120e5565b85600052602060002060005b848110156120dc5781548d82018501529089019088016120c1565b8c0160a0019550505b50929998505050505050505050565b604081526000612107604083018561202f565b8281036020840152611d378185611f59565b8381526001600160401b0383166020820152606060408201526000611d37606083018461202f565b634e487b7160e01b600052603260045260246000fd5b601f82111561152b576000816000526020600020601f850160051c810160208610156121805750805b601f850160051c820191505b8181101561219f5782815560010161218c565b505050505050565b6001600160401b038311156121be576121be611e96565b6121d2836121cc8354611f1f565b83612157565b6000601f84116001811461220657600085156121ee5750838201355b600019600387901b1c1916600186901b1783556112d4565b600083815260209020601f19861690835b828110156122375786850135825560209485019460019092019101612217565b50868210156122545760001960f88860031b161c19848701351681555b505060018560011b0183555050505050565b813561227181611eac565b6001600160401b0380821691508254826001600160401b03198216178455602085013561229d81611aeb565b6001600160e01b031991909116909217604092831b68010000000000000000600160e01b031617835590830135600183015560608301359036849003601e190182126122e857600080fd5b908301908135818111156122fb57600080fd5b60208301925080360383131561231057600080fd5b6112d48184600287016121a7565b60006001820161233e57634e487b7160e01b600052601160045260246000fd5b506001019056fea264697066735822122040247a490a3f4d972df7a2f562d35f74c3f6d5170cbd55219c2e785b213f189364736f6c63430008180033", } // SolveInboxABI is the input ABI used to generate the binding from. @@ -296,6 +296,37 @@ 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)[])) +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)[])) +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)[])) +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)[])) diff --git a/contracts/bindings/solveoutbox.go b/contracts/bindings/solveoutbox.go index 97e0ff81d..a65bdf85e 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: "0x60a06040523480156200001157600080fd5b5063ffffffff60643b1615620000975760646001600160a01b031663a3b1b31d6040518163ffffffff1660e01b8152600401602060405180830381865afa9250505080156200007f575060408051601f3d908101601f191682019092526200007c9181019062000110565b60015b6200008e57436080526200009c565b6080526200009c565b436080525b620000a6620000ac565b6200012a565b63409feecd1980546001811615620000cc5763f92ee8a96000526004601cfd5b8160c01c808260011c146200010b578060011b8355806020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b505050565b6000602082840312156200012357600080fd5b5051919050565b60805161162e6200014660003960006103d0015261162e6000f3fe6080604052600436106101405760003560e01c80635ba15647116100b6578063cb01a09a1161006f578063cb01a09a146103ab578063eae4c19f146103be578063f04e283e146103f2578063f2fde38b14610405578063f8c8765e14610418578063fee81cf41461043857600080fd5b80635ba15647146102cc5780635db9cbe4146102ec578063715018a61461031c57806374eeb847146103245780638da5cb5b14610357578063b23ade801461037057600080fd5b80632b370b67116101085780632b370b67146101ef5780632de948071461020f57806339acf9f1146102425780634a4ee7b11461027a578063514e62fc1461028d57806354d1f13d146102c457600080fd5b8063183a4f6e14610145578063188a97aa1461015a5780631c10893f1461018d5780631cd64df4146101a057806325692962146101e7575b600080fd5b6101586101533660046110a1565b61046b565b005b34801561016657600080fd5b5061017a6101753660046110d7565b610478565b6040519081526020015b60405180910390f35b61015861019b366004611110565b6104cf565b3480156101ac57600080fd5b506101d76101bb366004611110565b638b78c6d8600c90815260009290925260209091205481161490565b6040519015158152602001610184565b6101586104e5565b3480156101fb57600080fd5b5061015861020a366004611152565b610535565b34801561021b57600080fd5b5061017a61022a36600461119e565b638b78c6d8600c908152600091909152602090205490565b34801561024e57600080fd5b50600054610262906001600160a01b031681565b6040516001600160a01b039091168152602001610184565b610158610288366004611110565b6105b4565b34801561029957600080fd5b506101d76102a8366004611110565b638b78c6d8600c90815260009290925260209091205416151590565b6101586105c6565b3480156102d857600080fd5b506101d76102e73660046111d1565b610602565b3480156102f857600080fd5b506101d76103073660046110a1565b60046020526000908152604090205460ff1681565b61015861062f565b34801561033057600080fd5b5060005461034590600160a01b900460ff1681565b60405160ff9091168152602001610184565b34801561036357600080fd5b50638b78c6d81954610262565b34801561037c57600080fd5b506101d761038b366004611228565b600360209081526000928352604080842090915290825290205460ff1681565b6101586103b936600461125b565b610643565b3480156103ca57600080fd5b5061017a7f000000000000000000000000000000000000000000000000000000000000000081565b61015861040036600461119e565b610af4565b61015861041336600461119e565b610b31565b34801561042457600080fd5b5061015861043336600461130d565b610b58565b34801561044457600080fd5b5061017a61045336600461119e565b63389a75e1600c908152600091909152602090205490565b6104753382610c04565b50565b6040516000196024820181905260448201526000906104c990839060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052620186a0610c10565b92915050565b6104d7610c8e565b6104e18282610ca9565b5050565b60006202a30067ffffffffffffffff164201905063389a75e1600c5233600052806020600c2055337fdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d600080a250565b61053d610c8e565b6001600160a01b03831660008181526003602090815260408083206001600160e01b0319871680855290835292819020805460ff191686151590811790915590519081529192917f4a2dc3dabd793cd88cb7b56ba4aa70196892e5b996fc72f4f3d45e20343d305b910160405180910390a3505050565b6105bc610c8e565b6104e18282610c04565b63389a75e1600c523360005260006020600c2055337ffa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92600080a2565b600060046000610613868686610cb5565b815260208101919091526040016000205460ff16949350505050565b610637610c8e565b6106416000610ceb565b565b600161064e81610d29565b3068929eee149b4bd21268540361066d5763ab143c066000526004601cfd5b3068929eee149b4bd21268554661068760208601866110d7565b67ffffffffffffffff16146106af5760405163fd24301760e01b815260040160405180910390fd5b600360006106c3604087016020880161119e565b6001600160a01b0316815260208101919091526040016000908120906106ec6060870187611361565b6106f5916113af565b6001600160e01b031916815260208101919091526040016000205460ff16610730576040516315dace2d60e21b815260040160405180910390fd5b600061073d878787610cb5565b60008181526004602052604090205490915060ff161561077057604051630c4a31a760e01b815260040160405180910390fd5b6000818152600460205260408120805460ff191660011790558367ffffffffffffffff8111156107a2576107a26113df565b6040519080825280602002602001820160405280156107cb578160200160208202803683370190505b50905060005b8481101561091557610814308787848181106107ef576107ef6113f5565b610805926020606090920201908101915061119e565b6001600160a01b031690610d4f565b828281518110610826576108266113f5565b60200260200101818152505061088c3330888885818110610849576108496113f5565b90506060020160400135898986818110610865576108656113f5565b61087b926020606090920201908101915061119e565b6001600160a01b0316929190610d7b565b61090d8686838181106108a1576108a16113f5565b90506060020160200160208101906108b9919061119e565b8787848181106108cb576108cb6113f5565b905060600201604001358888858181106108e7576108e76113f5565b6108fd926020606090920201908101915061119e565b6001600160a01b03169190610dd9565b6001016107d1565b506000610928604088016020890161119e565b6001600160a01b0316604088013561094360608a018a611361565b60405161095192919061140b565b60006040518083038185875af1925050503d806000811461098e576040519150601f19603f3d011682016040523d82523d6000602084013e610993565b606091505b50509050806109b557604051633204506f60e01b815260040160405180910390fd5b60005b85811015610a16578281815181106109d2576109d26113f5565b60200260200101516109f0308989858181106107ef576107ef6113f5565b14610a0e5760405163903c78cd60e01b815260040160405180910390fd5b6001016109b8565b50604051602481018a90526044810184905260009060640160408051601f198184030181529190526020810180516001600160e01b031663019bfff160e51b179052600254909150600090610a7d908b906004906001600160a01b031685620186a0610e29565b905080610a8e60408b01353461141b565b1015610aac5760405162976f7560e21b815260040160405180910390fd5b604051339086908d907f7898a125e0970666c80e00bbf2e7041d84dfe5bbe6bcf562ce53d540fd6cd89190600090a450505050503868929eee149b4bd2126855505050505050565b610afc610c8e565b63389a75e1600c52806000526020600c208054421115610b2457636f5e88186000526004601cfd5b6000905561047581610ceb565b610b39610c8e565b8060601b610b4f57637448fbae6000526004601cfd5b61047581610ceb565b63409feecd198054600382558015610b8f5760018160011c14303b10610b865763f92ee8a96000526004601cfd5b818160ff1b1b91505b50610b9985610f6d565b610ba4846001610ca9565b610bad83610fa9565b600280546001600160a01b0319166001600160a01b0384161790558015610bfd576002815560016020527fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d2602080a15b5050505050565b6104e182826000611048565b60008054604051632376548f60e21b81526001600160a01b0390911690638dd9523c90610c4590879087908790600401611482565b602060405180830381865afa158015610c62573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c8691906114b9565b949350505050565b638b78c6d819543314610641576382b429006000526004601cfd5b6104e182826001611048565b6000838383604051602001610ccc939291906114fb565b6040516020818303038152906040528051906020012090509392505050565b638b78c6d81980546001600160a01b039092169182907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0600080a355565b638b78c6d8600c5233600052806020600c205416610475576382b429006000526004601cfd5b6000816014526370a0823160601b60005260208060246010865afa601f3d111660205102905092915050565b60405181606052826040528360601b602c526323b872dd60601b600c52602060006064601c6000895af18060016000511416610dca57803d873b151710610dca57637939f4246000526004601cfd5b50600060605260405250505050565b816014528060345263095ea7b360601b60005260206000604460106000875af18060016000511416610e1e57803d853b151710610e1e57633e3f8f736000526004601cfd5b506000603452505050565b60008054604051632376548f60e21b815282916001600160a01b031690638dd9523c90610e5e908a9088908890600401611482565b602060405180830381865afa158015610e7b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e9f91906114b9565b905080471015610ef65760405162461bcd60e51b815260206004820152601860248201527f584170703a20696e73756666696369656e742066756e6473000000000000000060448201526064015b60405180910390fd5b60005460405163c21dda4f60e01b81526001600160a01b039091169063c21dda4f908390610f30908b908b908b908b908b906004016115a8565b6000604051808303818588803b158015610f4957600080fd5b505af1158015610f5d573d6000803e3d6000fd5b50939a9950505050505050505050565b6001600160a01b0316638b78c6d8198190558060007f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a350565b6001600160a01b038116610ff45760405162461bcd60e51b8152602060048201526012602482015271584170703a206e6f207a65726f206f6d6e6960701b6044820152606401610eed565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f79162c8d053a07e70cdc1ccc536f0440b571f8508377d2bef51094fadab98f479060200160405180910390a150565b638b78c6d8600c52826000526020600c2080548381178361106a575080841681185b80835580600c5160601c7f715ad5ce61fc9595c7b415289d59cf203f23a94fa06f04af7e489a0a76e1fe26600080a3505050505050565b6000602082840312156110b357600080fd5b5035919050565b803567ffffffffffffffff811681146110d257600080fd5b919050565b6000602082840312156110e957600080fd5b6110f2826110ba565b9392505050565b80356001600160a01b03811681146110d257600080fd5b6000806040838503121561112357600080fd5b61112c836110f9565b946020939093013593505050565b80356001600160e01b0319811681146110d257600080fd5b60008060006060848603121561116757600080fd5b611170846110f9565b925061117e6020850161113a565b91506040840135801515811461119357600080fd5b809150509250925092565b6000602082840312156111b057600080fd5b6110f2826110f9565b6000608082840312156111cb57600080fd5b50919050565b6000806000606084860312156111e657600080fd5b833592506111f6602085016110ba565b9150604084013567ffffffffffffffff81111561121257600080fd5b61121e868287016111b9565b9150509250925092565b6000806040838503121561123b57600080fd5b611244836110f9565b91506112526020840161113a565b90509250929050565b60008060008060006080868803121561127357600080fd5b85359450611283602087016110ba565b9350604086013567ffffffffffffffff808211156112a057600080fd5b6112ac89838a016111b9565b945060608801359150808211156112c257600080fd5b818801915088601f8301126112d657600080fd5b8135818111156112e557600080fd5b8960206060830285010111156112fa57600080fd5b9699959850939650602001949392505050565b6000806000806080858703121561132357600080fd5b61132c856110f9565b935061133a602086016110f9565b9250611348604086016110f9565b9150611356606086016110f9565b905092959194509250565b6000808335601e1984360301811261137857600080fd5b83018035915067ffffffffffffffff82111561139357600080fd5b6020019150368190038213156113a857600080fd5b9250929050565b6001600160e01b031981358181169160048510156113d75780818660040360031b1b83161692505b505092915050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b8183823760009101908152919050565b818103818111156104c957634e487b7160e01b600052601160045260246000fd5b6000815180845260005b8181101561146257602081850181015186830182015201611446565b506000602082860101526020601f19601f83011685010191505092915050565b600067ffffffffffffffff8086168352606060208401526114a6606084018661143c565b9150808416604084015250949350505050565b6000602082840312156114cb57600080fd5b5051919050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b838152600067ffffffffffffffff80851660208401526060604084015280611522856110ba565b1660608401526001600160a01b0361153c602086016110f9565b166080840152604084013560a08401526060840135601e1985360301811261156357600080fd5b84016020810190358281111561157857600080fd5b80360382131561158757600080fd5b608060c086015261159c60e0860182846114d2565b98975050505050505050565b600067ffffffffffffffff808816835260ff8716602084015260018060a01b038616604084015260a060608401526115e360a084018661143c565b9150808416608084015250969550505050505056fea2646970667358221220b1365ed1962463ccf6fe81a85cd0b651f50923a67faa69b37c1a1906b2c4718c64736f6c63430008180033", } // 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..d9a8ab1b2 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: 449411) +SolveInbox_accept_Test:test_accept_reverts() (gas: 1135399) +SolveInbox_accept_Test:test_accept_skip_first() (gas: 757442) +SolveInbox_accept_Test:test_accept_two_requests() (gas: 781616) +SolveInbox_cancel_Test:test_cancel_multiToken() (gas: 604009) +SolveInbox_cancel_Test:test_cancel_nativeMultiToken() (gas: 694160) +SolveInbox_cancel_Test:test_cancel_oldest_request() (gas: 758515) +SolveInbox_cancel_Test:test_cancel_one_request() (gas: 450572) +SolveInbox_cancel_Test:test_cancel_rejected_nativeMultiToken_request() (gas: 738004) +SolveInbox_cancel_Test:test_cancel_rejected_nativeToken_request() (gas: 491782) +SolveInbox_cancel_Test:test_cancel_reverts() (gas: 1157387) +SolveInbox_cancel_Test:test_cancel_singleToken() (gas: 482102) +SolveInbox_cancel_Test:test_cancel_two_requests() (gas: 760517) +SolveInbox_claim_Test:test_claim_multiDeposit() (gas: 819751) +SolveInbox_claim_Test:test_claim_reverts() (gas: 537428) +SolveInbox_claim_Test:test_claim_singleNative() (gas: 569792) +SolveInbox_claim_Test:test_claim_singleToken() (gas: 600715) +SolveInbox_markFulfilled_Test:test_markFulfilled_reverts() (gas: 551134) +SolveInbox_markFulfilled_Test:test_markFulfilled_success() (gas: 493564) +SolveInbox_reject_Test:test_reject_nativeMultiToken() (gas: 657806) +SolveInbox_reject_Test:test_reject_oldest_request() (gas: 730802) +SolveInbox_reject_Test:test_reject_one_request() (gas: 422363) +SolveInbox_reject_Test:test_reject_reverts() (gas: 815736) +SolveInbox_reject_Test:test_reject_two_requests() (gas: 725273) +SolveInbox_request_Test:test_request_multiToken() (gas: 584500) +SolveInbox_request_Test:test_request_nativeMultiToken() (gas: 643788) +SolveInbox_request_Test:test_request_reverts() (gas: 1018635) +SolveInbox_request_Test:test_request_singleNative() (gas: 402136) +SolveInbox_request_Test:test_request_singleToken() (gas: 463652) +SolveInbox_request_Test:test_request_two() (gas: 711209) 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..d8f20fcf4 100644 --- a/contracts/solve/src/Solve.sol +++ b/contracts/solve/src/Solve.sol @@ -34,6 +34,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; diff --git a/contracts/solve/src/SolveInbox.sol b/contracts/solve/src/SolveInbox.sol index cda763f87..88ad9fd58 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,13 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I return _requests[id]; } + /** + * @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. @@ -134,6 +153,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.status = Solve.Status.Accepted; req.acceptedBy = msg.sender; + _latestReqByStatus[Solve.Status.Accepted] = id; + emit Accepted(id, msg.sender); } @@ -149,6 +170,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.updatedAt = uint40(block.timestamp); req.status = Solve.Status.Rejected; + _latestReqByStatus[Solve.Status.Rejected] = id; + emit Rejected(id, msg.sender, reason); } @@ -165,6 +188,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.updatedAt = uint40(block.timestamp); req.status = Solve.Status.Reverted; + _latestReqByStatus[Solve.Status.Reverted] = id; + _transferDeposits(req.from, req.deposits); emit Reverted(id); @@ -186,6 +211,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.updatedAt = uint40(block.timestamp); req.status = Solve.Status.Fulfilled; + _latestReqByStatus[Solve.Status.Fulfilled] = id; + emit Fulfilled(id, callHash, req.acceptedBy); } @@ -202,6 +229,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.updatedAt = uint40(block.timestamp); req.status = Solve.Status.Claimed; + _latestReqByStatus[Solve.Status.Claimed] = id; + _transferDeposits(to, req.deposits); emit Claimed(id, msg.sender, to, req.deposits); @@ -241,6 +270,8 @@ contract SolveInbox is OwnableRoles, ReentrancyGuard, Initializable, XAppBase, I req.from = from; req.call = call; + _latestReqByStatus[Solve.Status.Pending] = id; + if (msg.value > 0) { req.deposits.push(Solve.Deposit({ isNative: true, token: address(0), amount: msg.value })); } @@ -271,4 +302,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..78dea9bd2 100644 --- a/contracts/solve/src/interfaces/ISolveInbox.sol +++ b/contracts/solve/src/interfaces/ISolveInbox.sol @@ -56,6 +56,11 @@ interface ISolveInbox { */ function getRequest(bytes32 id) external view returns (Solve.Request 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..9d6a3cd73 100644 --- a/contracts/solve/test/Inbox_accept.t.sol +++ b/contracts/solve/test/Inbox_accept.t.sol @@ -81,6 +81,11 @@ 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)" + ); } /// @dev Test accepting two requests @@ -104,6 +109,11 @@ 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)" + ); } /// @dev Test accepting requests out of order @@ -126,5 +136,10 @@ 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)" + ); } } diff --git a/contracts/solve/test/Inbox_cancel.t.sol b/contracts/solve/test/Inbox_cancel.t.sol index 353ff133f..dd3e79f5c 100644 --- a/contracts/solve/test/Inbox_cancel.t.sol +++ b/contracts/solve/test/Inbox_cancel.t.sol @@ -75,6 +75,11 @@ 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)" + ); } function test_cancel_two_requests() public { @@ -97,6 +102,11 @@ 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)" + ); } function test_cancel_oldest_request() public { @@ -117,6 +127,16 @@ 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)" + ); } function test_cancel_singleToken() public { @@ -136,6 +156,11 @@ 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)" + ); } function test_cancel_multiToken() public { @@ -158,6 +183,11 @@ 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)" + ); } function test_cancel_nativeMultiToken() public { @@ -183,6 +213,11 @@ 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)" + ); } function test_cancel_rejected_nativeToken_request() public { @@ -204,6 +239,16 @@ 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)" + ); } function test_cancel_rejected_nativeMultiToken_request() public { @@ -233,5 +278,15 @@ 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)" + ); } } diff --git a/contracts/solve/test/Inbox_claim.t.sol b/contracts/solve/test/Inbox_claim.t.sol index 3818920e3..a3cfdf817 100644 --- a/contracts/solve/test/Inbox_claim.t.sol +++ b/contracts/solve/test/Inbox_claim.t.sol @@ -72,6 +72,11 @@ 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)" + ); } function test_claim_singleToken() public { @@ -91,6 +96,11 @@ 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)" + ); } function test_claim_multiDeposit() public { @@ -113,6 +123,11 @@ 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)" + ); } /// @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..b833a1fff 100644 --- a/contracts/solve/test/Inbox_markFulfilled.t.sol +++ b/contracts/solve/test/Inbox_markFulfilled.t.sol @@ -81,5 +81,10 @@ 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)" + ); } } diff --git a/contracts/solve/test/Inbox_reject.t.sol b/contracts/solve/test/Inbox_reject.t.sol index 9a220ee17..4aa04255f 100644 --- a/contracts/solve/test/Inbox_reject.t.sol +++ b/contracts/solve/test/Inbox_reject.t.sol @@ -63,6 +63,11 @@ 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)" + ); } function test_reject_two_requests() public { @@ -85,6 +90,11 @@ 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)" + ); } function test_reject_oldest_request() public { @@ -106,6 +116,16 @@ 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)" + ); } function test_reject_nativeMultiToken() public { @@ -131,5 +151,10 @@ 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)" + ); } } diff --git a/contracts/solve/test/Inbox_request.t.sol b/contracts/solve/test/Inbox_request.t.sol index c7b96f44a..5a50ec39d 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,