diff --git a/packages/relayer/TaikoL1.json b/packages/relayer/TaikoL1.json deleted file mode 100644 index d27319e81f..0000000000 --- a/packages/relayer/TaikoL1.json +++ /dev/null @@ -1,945 +0,0 @@ -[ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "commitSlot", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "commitHeight", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "commitHash", - "type": "bytes32" - } - ], - "name": "BlockCommitted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "l1Height", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "l1Hash", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "beneficiary", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "txListHash", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "mixHash", - "type": "bytes32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - }, - { - "internalType": "uint64", - "name": "gasLimit", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "commitHeight", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "commitSlot", - "type": "uint64" - } - ], - "indexed": false, - "internalType": "struct TaikoData.BlockMetadata", - "name": "meta", - "type": "tuple" - } - ], - "name": "BlockProposed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "parentHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "timestamp", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "provenAt", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "address", - "name": "prover", - "type": "address" - } - ], - "name": "BlockProven", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "blockHash", - "type": "bytes32" - } - ], - "name": "BlockVerified", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bool", - "name": "halted", - "type": "bool" - } - ], - "name": "Halted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "height", - "type": "uint256" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "srcHeight", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "srcHash", - "type": "bytes32" - } - ], - "name": "HeaderSynced", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "addressManager", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "commitSlot", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "commitHash", - "type": "bytes32" - } - ], - "name": "commitBlock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getBlockFee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "parentHash", - "type": "bytes32" - } - ], - "name": "getBlockProvers", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxNumBlocks", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockHashHistory", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "zkProofsPerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxVerificationsPerTx", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commitConfirmations", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxProofsPerForkChoice", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockMaxGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTransactionsPerBlock", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxBytesPerTxList", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minTxGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "anchorTxGasLimit", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feePremiumLamda", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rewardBurnBips", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proposerDepositPctg", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "feeBaseMAF", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "blockTimeMAF", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "proofTimeMAF", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "rewardMultiplierPctg", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "feeGracePeriodPctg", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "feeMaxPeriodPctg", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "blockTimeCap", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "proofTimeCap", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "bootstrapDiscountHalvingPeriod", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "initialUncleDelay", - "type": "uint64" - }, - { - "internalType": "bool", - "name": "enableTokenomics", - "type": "bool" - } - ], - "internalType": "struct TaikoData.Config", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getLatestSyncedHeader", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "provenAt", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "proposedAt", - "type": "uint64" - } - ], - "name": "getProofReward", - "outputs": [ - { - "internalType": "uint256", - "name": "reward", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getProposedBlock", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "metaHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "deposit", - "type": "uint256" - }, - { - "internalType": "address", - "name": "proposer", - "type": "address" - }, - { - "internalType": "uint64", - "name": "proposedAt", - "type": "uint64" - } - ], - "internalType": "struct TaikoData.ProposedBlock", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getStateVariables", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "number", - "type": "uint256" - } - ], - "name": "getSyncedHeader", - "outputs": [ - { - "internalType": "bytes32", - "name": "header", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockId", - "type": "uint256" - } - ], - "name": "getUncleProofDelay", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "toHalt", - "type": "bool" - } - ], - "name": "halt", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "_addressManager", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "_genesisBlockHash", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "_feeBase", - "type": "uint256" - } - ], - "name": "init", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "commitSlot", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "commitHeight", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "commitHash", - "type": "bytes32" - } - ], - "name": "isCommitValid", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isHalted", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "inputs", - "type": "bytes[]" - } - ], - "name": "proposeBlock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockId", - "type": "uint256" - }, - { - "internalType": "bytes[]", - "name": "inputs", - "type": "bytes[]" - } - ], - "name": "proveBlock", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "blockId", - "type": "uint256" - }, - { - "internalType": "bytes[]", - "name": "inputs", - "type": "bytes[]" - } - ], - "name": "proveBlockInvalid", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "resolve", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - } - ], - "name": "resolve", - "outputs": [ - { - "internalType": "address payable", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "hash", - "type": "bytes32" - }, - { - "internalType": "uint8", - "name": "k", - "type": "uint8" - } - ], - "name": "signWithGoldenTouch", - "outputs": [ - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "r", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "s", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "state", - "outputs": [ - { - "internalType": "uint64", - "name": "genesisHeight", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "genesisTimestamp", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "__reservedA1", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "statusBits", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "feeBase", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "nextBlockId", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "lastProposedAt", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "avgBlockTime", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "__avgGasLimit", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "latestVerifiedHeight", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "latestVerifiedId", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "avgProofTime", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "__reservedC1", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxBlocks", - "type": "uint256" - } - ], - "name": "verifyBlocks", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } -] diff --git a/packages/relayer/abigen.sh b/packages/relayer/abigen.sh index b29393a4e9..9fe24d098e 100755 --- a/packages/relayer/abigen.sh +++ b/packages/relayer/abigen.sh @@ -12,11 +12,11 @@ names=("Bridge" "IHeaderSync" "TaikoL2" "TaikoL1") for (( i = 0; i < ${#paths[@]}; ++i )); do jq .abi ../protocol/artifacts/contracts/${paths[i]}/${names[i]}.json > ${names[i]}.json - echo $abi + lower=$(echo "${names[i]}" | tr '[:upper:]' '[:lower:]') abigen --abi ${names[i]}.json \ - --pkg contracts \ + --pkg $lower \ --type ${names[i]} \ - --out contracts/${names[i]}.go + --out contracts/$lower/${names[i]}.go done exit 0 diff --git a/packages/relayer/bridge.go b/packages/relayer/bridge.go index 374c3625f2..0ab984735c 100644 --- a/packages/relayer/bridge.go +++ b/packages/relayer/bridge.go @@ -6,17 +6,17 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) type Bridge interface { WatchMessageSent( opts *bind.WatchOpts, - sink chan<- *contracts.BridgeMessageSent, - signal [][32]byte, + sink chan<- *bridge.BridgeMessageSent, + msgHash [][32]byte, ) (event.Subscription, error) - FilterMessageSent(opts *bind.FilterOpts, signal [][32]byte) (*contracts.BridgeMessageSentIterator, error) - GetMessageStatus(opts *bind.CallOpts, signal [32]byte) (uint8, error) - ProcessMessage(opts *bind.TransactOpts, message contracts.IBridgeMessage, proof []byte) (*types.Transaction, error) - IsMessageReceived(opts *bind.CallOpts, signal [32]byte, srcChainId *big.Int, proof []byte) (bool, error) // nolint + FilterMessageSent(opts *bind.FilterOpts, msgHash [][32]byte) (*bridge.BridgeMessageSentIterator, error) + GetMessageStatus(opts *bind.CallOpts, msgHash [32]byte) (uint8, error) + ProcessMessage(opts *bind.TransactOpts, message bridge.IBridgeMessage, proof []byte) (*types.Transaction, error) + IsMessageReceived(opts *bind.CallOpts, msgHash [32]byte, srcChainId *big.Int, proof []byte) (bool, error) // nolint } diff --git a/packages/relayer/contracts/Bridge.go b/packages/relayer/contracts/bridge/Bridge.go similarity index 65% rename from packages/relayer/contracts/Bridge.go rename to packages/relayer/contracts/bridge/Bridge.go index 1b05c0c76e..37eebc0b63 100644 --- a/packages/relayer/contracts/Bridge.go +++ b/packages/relayer/contracts/bridge/Bridge.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package contracts +package bridge import ( "math/big" @@ -28,7 +28,7 @@ var ( // IBridgeContext is an auto generated low-level Go binding around an user-defined struct. type IBridgeContext struct { - Signal [32]byte + MsgHash [32]byte Sender common.Address SrcChainId *big.Int } @@ -51,7 +51,7 @@ type IBridgeMessage struct { } // BridgeABI is the input ABI used to generate the binding from. -const BridgeABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"DestChainEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"indexed\":false,\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"MessageSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumLibBridgeData.MessageStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"MessageStatusChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"name\":\"SignalSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"context\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"}],\"internalType\":\"structIBridge.Context\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"},{\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"enableDestChain\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"name\":\"getMessageStatus\",\"outputs\":[{\"internalType\":\"enumLibBridgeData.MessageStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"isDestChainEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"isMessageReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"name\":\"isMessageSent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"isSignalReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"name\":\"isSignalSent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"processMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"isLastAttempt\",\"type\":\"bool\"}],\"name\":\"retryMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"signal\",\"type\":\"bytes32\"}],\"name\":\"sendSignal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]" +const BridgeABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"enabled\",\"type\":\"bool\"}],\"name\":\"DestChainEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"EtherReleased\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"indexed\":false,\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"MessageSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"enumLibBridgeStatus.MessageStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"MessageStatusChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"SignalSent\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"context\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"}],\"internalType\":\"structIBridge.Context\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"getMessageStatus\",\"outputs\":[{\"internalType\":\"enumLibBridgeStatus.MessageStatus\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"getMessageStatusSlot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"hashMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"_chainId\",\"type\":\"uint256\"}],\"name\":\"isDestChainEnabled\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"isMessageFailed\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"isMessageReceived\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"name\":\"isMessageSent\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"processMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proof\",\"type\":\"bytes\"}],\"name\":\"releaseEther\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"},{\"internalType\":\"bool\",\"name\":\"isLastAttempt\",\"type\":\"bool\"}],\"name\":\"retryMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"srcChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"destChainId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"refundAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"callValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"processingFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"gasLimit\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"},{\"internalType\":\"string\",\"name\":\"memo\",\"type\":\"string\"}],\"internalType\":\"structIBridge.Message\",\"name\":\"message\",\"type\":\"tuple\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"msgHash\",\"type\":\"bytes32\"}],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}]" // Bridge is an auto generated Go binding around an Ethereum contract. type Bridge struct { @@ -259,10 +259,10 @@ func (_Bridge *BridgeCallerSession) Context() (IBridgeContext, error) { // GetMessageStatus is a free data retrieval call binding the contract method 0x5075a9d4. // -// Solidity: function getMessageStatus(bytes32 signal) view returns(uint8) -func (_Bridge *BridgeCaller) GetMessageStatus(opts *bind.CallOpts, signal [32]byte) (uint8, error) { +// Solidity: function getMessageStatus(bytes32 msgHash) view returns(uint8) +func (_Bridge *BridgeCaller) GetMessageStatus(opts *bind.CallOpts, msgHash [32]byte) (uint8, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "getMessageStatus", signal) + err := _Bridge.contract.Call(opts, &out, "getMessageStatus", msgHash) if err != nil { return *new(uint8), err @@ -276,55 +276,86 @@ func (_Bridge *BridgeCaller) GetMessageStatus(opts *bind.CallOpts, signal [32]by // GetMessageStatus is a free data retrieval call binding the contract method 0x5075a9d4. // -// Solidity: function getMessageStatus(bytes32 signal) view returns(uint8) -func (_Bridge *BridgeSession) GetMessageStatus(signal [32]byte) (uint8, error) { - return _Bridge.Contract.GetMessageStatus(&_Bridge.CallOpts, signal) +// Solidity: function getMessageStatus(bytes32 msgHash) view returns(uint8) +func (_Bridge *BridgeSession) GetMessageStatus(msgHash [32]byte) (uint8, error) { + return _Bridge.Contract.GetMessageStatus(&_Bridge.CallOpts, msgHash) } // GetMessageStatus is a free data retrieval call binding the contract method 0x5075a9d4. // -// Solidity: function getMessageStatus(bytes32 signal) view returns(uint8) -func (_Bridge *BridgeCallerSession) GetMessageStatus(signal [32]byte) (uint8, error) { - return _Bridge.Contract.GetMessageStatus(&_Bridge.CallOpts, signal) +// Solidity: function getMessageStatus(bytes32 msgHash) view returns(uint8) +func (_Bridge *BridgeCallerSession) GetMessageStatus(msgHash [32]byte) (uint8, error) { + return _Bridge.Contract.GetMessageStatus(&_Bridge.CallOpts, msgHash) } -// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. +// GetMessageStatusSlot is a free data retrieval call binding the contract method 0x606b5b74. // -// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) -func (_Bridge *BridgeCaller) IsDestChainEnabled(opts *bind.CallOpts, _chainId *big.Int) (bool, error) { +// Solidity: function getMessageStatusSlot(bytes32 msgHash) pure returns(bytes32) +func (_Bridge *BridgeCaller) GetMessageStatusSlot(opts *bind.CallOpts, msgHash [32]byte) ([32]byte, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "isDestChainEnabled", _chainId) + err := _Bridge.contract.Call(opts, &out, "getMessageStatusSlot", msgHash) if err != nil { - return *new(bool), err + return *new([32]byte), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) return out0, err } -// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. +// GetMessageStatusSlot is a free data retrieval call binding the contract method 0x606b5b74. // -// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) -func (_Bridge *BridgeSession) IsDestChainEnabled(_chainId *big.Int) (bool, error) { - return _Bridge.Contract.IsDestChainEnabled(&_Bridge.CallOpts, _chainId) +// Solidity: function getMessageStatusSlot(bytes32 msgHash) pure returns(bytes32) +func (_Bridge *BridgeSession) GetMessageStatusSlot(msgHash [32]byte) ([32]byte, error) { + return _Bridge.Contract.GetMessageStatusSlot(&_Bridge.CallOpts, msgHash) } -// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. +// GetMessageStatusSlot is a free data retrieval call binding the contract method 0x606b5b74. // -// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) -func (_Bridge *BridgeCallerSession) IsDestChainEnabled(_chainId *big.Int) (bool, error) { - return _Bridge.Contract.IsDestChainEnabled(&_Bridge.CallOpts, _chainId) +// Solidity: function getMessageStatusSlot(bytes32 msgHash) pure returns(bytes32) +func (_Bridge *BridgeCallerSession) GetMessageStatusSlot(msgHash [32]byte) ([32]byte, error) { + return _Bridge.Contract.GetMessageStatusSlot(&_Bridge.CallOpts, msgHash) } -// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. +// HashMessage is a free data retrieval call binding the contract method 0x5817b0c3. // -// Solidity: function isMessageReceived(bytes32 signal, uint256 srcChainId, bytes proof) view returns(bool) -func (_Bridge *BridgeCaller) IsMessageReceived(opts *bind.CallOpts, signal [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { +// Solidity: function hashMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) pure returns(bytes32) +func (_Bridge *BridgeCaller) HashMessage(opts *bind.CallOpts, message IBridgeMessage) ([32]byte, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "isMessageReceived", signal, srcChainId, proof) + err := _Bridge.contract.Call(opts, &out, "hashMessage", message) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// HashMessage is a free data retrieval call binding the contract method 0x5817b0c3. +// +// Solidity: function hashMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) pure returns(bytes32) +func (_Bridge *BridgeSession) HashMessage(message IBridgeMessage) ([32]byte, error) { + return _Bridge.Contract.HashMessage(&_Bridge.CallOpts, message) +} + +// HashMessage is a free data retrieval call binding the contract method 0x5817b0c3. +// +// Solidity: function hashMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) pure returns(bytes32) +func (_Bridge *BridgeCallerSession) HashMessage(message IBridgeMessage) ([32]byte, error) { + return _Bridge.Contract.HashMessage(&_Bridge.CallOpts, message) +} + +// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. +// +// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) +func (_Bridge *BridgeCaller) IsDestChainEnabled(opts *bind.CallOpts, _chainId *big.Int) (bool, error) { + var out []interface{} + err := _Bridge.contract.Call(opts, &out, "isDestChainEnabled", _chainId) if err != nil { return *new(bool), err @@ -336,26 +367,26 @@ func (_Bridge *BridgeCaller) IsMessageReceived(opts *bind.CallOpts, signal [32]b } -// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. +// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. // -// Solidity: function isMessageReceived(bytes32 signal, uint256 srcChainId, bytes proof) view returns(bool) -func (_Bridge *BridgeSession) IsMessageReceived(signal [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { - return _Bridge.Contract.IsMessageReceived(&_Bridge.CallOpts, signal, srcChainId, proof) +// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) +func (_Bridge *BridgeSession) IsDestChainEnabled(_chainId *big.Int) (bool, error) { + return _Bridge.Contract.IsDestChainEnabled(&_Bridge.CallOpts, _chainId) } -// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. +// IsDestChainEnabled is a free data retrieval call binding the contract method 0x5d0bd986. // -// Solidity: function isMessageReceived(bytes32 signal, uint256 srcChainId, bytes proof) view returns(bool) -func (_Bridge *BridgeCallerSession) IsMessageReceived(signal [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { - return _Bridge.Contract.IsMessageReceived(&_Bridge.CallOpts, signal, srcChainId, proof) +// Solidity: function isDestChainEnabled(uint256 _chainId) view returns(bool) +func (_Bridge *BridgeCallerSession) IsDestChainEnabled(_chainId *big.Int) (bool, error) { + return _Bridge.Contract.IsDestChainEnabled(&_Bridge.CallOpts, _chainId) } -// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. +// IsMessageFailed is a free data retrieval call binding the contract method 0xce70f39b. // -// Solidity: function isMessageSent(bytes32 signal) view returns(bool) -func (_Bridge *BridgeCaller) IsMessageSent(opts *bind.CallOpts, signal [32]byte) (bool, error) { +// Solidity: function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeCaller) IsMessageFailed(opts *bind.CallOpts, msgHash [32]byte, destChainId *big.Int, proof []byte) (bool, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "isMessageSent", signal) + err := _Bridge.contract.Call(opts, &out, "isMessageFailed", msgHash, destChainId, proof) if err != nil { return *new(bool), err @@ -367,26 +398,26 @@ func (_Bridge *BridgeCaller) IsMessageSent(opts *bind.CallOpts, signal [32]byte) } -// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. +// IsMessageFailed is a free data retrieval call binding the contract method 0xce70f39b. // -// Solidity: function isMessageSent(bytes32 signal) view returns(bool) -func (_Bridge *BridgeSession) IsMessageSent(signal [32]byte) (bool, error) { - return _Bridge.Contract.IsMessageSent(&_Bridge.CallOpts, signal) +// Solidity: function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeSession) IsMessageFailed(msgHash [32]byte, destChainId *big.Int, proof []byte) (bool, error) { + return _Bridge.Contract.IsMessageFailed(&_Bridge.CallOpts, msgHash, destChainId, proof) } -// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. +// IsMessageFailed is a free data retrieval call binding the contract method 0xce70f39b. // -// Solidity: function isMessageSent(bytes32 signal) view returns(bool) -func (_Bridge *BridgeCallerSession) IsMessageSent(signal [32]byte) (bool, error) { - return _Bridge.Contract.IsMessageSent(&_Bridge.CallOpts, signal) +// Solidity: function isMessageFailed(bytes32 msgHash, uint256 destChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeCallerSession) IsMessageFailed(msgHash [32]byte, destChainId *big.Int, proof []byte) (bool, error) { + return _Bridge.Contract.IsMessageFailed(&_Bridge.CallOpts, msgHash, destChainId, proof) } -// IsSignalReceived is a free data retrieval call binding the contract method 0x3aec8585. +// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. // -// Solidity: function isSignalReceived(bytes32 signal, uint256 srcChainId, address sender, bytes proof) view returns(bool) -func (_Bridge *BridgeCaller) IsSignalReceived(opts *bind.CallOpts, signal [32]byte, srcChainId *big.Int, sender common.Address, proof []byte) (bool, error) { +// Solidity: function isMessageReceived(bytes32 msgHash, uint256 srcChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeCaller) IsMessageReceived(opts *bind.CallOpts, msgHash [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "isSignalReceived", signal, srcChainId, sender, proof) + err := _Bridge.contract.Call(opts, &out, "isMessageReceived", msgHash, srcChainId, proof) if err != nil { return *new(bool), err @@ -398,26 +429,26 @@ func (_Bridge *BridgeCaller) IsSignalReceived(opts *bind.CallOpts, signal [32]by } -// IsSignalReceived is a free data retrieval call binding the contract method 0x3aec8585. +// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. // -// Solidity: function isSignalReceived(bytes32 signal, uint256 srcChainId, address sender, bytes proof) view returns(bool) -func (_Bridge *BridgeSession) IsSignalReceived(signal [32]byte, srcChainId *big.Int, sender common.Address, proof []byte) (bool, error) { - return _Bridge.Contract.IsSignalReceived(&_Bridge.CallOpts, signal, srcChainId, sender, proof) +// Solidity: function isMessageReceived(bytes32 msgHash, uint256 srcChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeSession) IsMessageReceived(msgHash [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { + return _Bridge.Contract.IsMessageReceived(&_Bridge.CallOpts, msgHash, srcChainId, proof) } -// IsSignalReceived is a free data retrieval call binding the contract method 0x3aec8585. +// IsMessageReceived is a free data retrieval call binding the contract method 0xa4444efd. // -// Solidity: function isSignalReceived(bytes32 signal, uint256 srcChainId, address sender, bytes proof) view returns(bool) -func (_Bridge *BridgeCallerSession) IsSignalReceived(signal [32]byte, srcChainId *big.Int, sender common.Address, proof []byte) (bool, error) { - return _Bridge.Contract.IsSignalReceived(&_Bridge.CallOpts, signal, srcChainId, sender, proof) +// Solidity: function isMessageReceived(bytes32 msgHash, uint256 srcChainId, bytes proof) view returns(bool) +func (_Bridge *BridgeCallerSession) IsMessageReceived(msgHash [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { + return _Bridge.Contract.IsMessageReceived(&_Bridge.CallOpts, msgHash, srcChainId, proof) } -// IsSignalSent is a free data retrieval call binding the contract method 0x32676bc6. +// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. // -// Solidity: function isSignalSent(address sender, bytes32 signal) view returns(bool) -func (_Bridge *BridgeCaller) IsSignalSent(opts *bind.CallOpts, sender common.Address, signal [32]byte) (bool, error) { +// Solidity: function isMessageSent(bytes32 msgHash) view returns(bool) +func (_Bridge *BridgeCaller) IsMessageSent(opts *bind.CallOpts, msgHash [32]byte) (bool, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "isSignalSent", sender, signal) + err := _Bridge.contract.Call(opts, &out, "isMessageSent", msgHash) if err != nil { return *new(bool), err @@ -429,18 +460,18 @@ func (_Bridge *BridgeCaller) IsSignalSent(opts *bind.CallOpts, sender common.Add } -// IsSignalSent is a free data retrieval call binding the contract method 0x32676bc6. +// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. // -// Solidity: function isSignalSent(address sender, bytes32 signal) view returns(bool) -func (_Bridge *BridgeSession) IsSignalSent(sender common.Address, signal [32]byte) (bool, error) { - return _Bridge.Contract.IsSignalSent(&_Bridge.CallOpts, sender, signal) +// Solidity: function isMessageSent(bytes32 msgHash) view returns(bool) +func (_Bridge *BridgeSession) IsMessageSent(msgHash [32]byte) (bool, error) { + return _Bridge.Contract.IsMessageSent(&_Bridge.CallOpts, msgHash) } -// IsSignalSent is a free data retrieval call binding the contract method 0x32676bc6. +// IsMessageSent is a free data retrieval call binding the contract method 0x540be6a3. // -// Solidity: function isSignalSent(address sender, bytes32 signal) view returns(bool) -func (_Bridge *BridgeCallerSession) IsSignalSent(sender common.Address, signal [32]byte) (bool, error) { - return _Bridge.Contract.IsSignalSent(&_Bridge.CallOpts, sender, signal) +// Solidity: function isMessageSent(bytes32 msgHash) view returns(bool) +func (_Bridge *BridgeCallerSession) IsMessageSent(msgHash [32]byte) (bool, error) { + return _Bridge.Contract.IsMessageSent(&_Bridge.CallOpts, msgHash) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -474,12 +505,12 @@ func (_Bridge *BridgeCallerSession) Owner() (common.Address, error) { return _Bridge.Contract.Owner(&_Bridge.CallOpts) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_Bridge *BridgeCaller) Resolve(opts *bind.CallOpts, name string) (common.Address, error) { +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeCaller) Resolve(opts *bind.CallOpts, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "resolve", name) + err := _Bridge.contract.Call(opts, &out, "resolve", name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -491,26 +522,26 @@ func (_Bridge *BridgeCaller) Resolve(opts *bind.CallOpts, name string) (common.A } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_Bridge *BridgeSession) Resolve(name string) (common.Address, error) { - return _Bridge.Contract.Resolve(&_Bridge.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeSession) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _Bridge.Contract.Resolve(&_Bridge.CallOpts, name, allowZeroAddress) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_Bridge *BridgeCallerSession) Resolve(name string) (common.Address, error) { - return _Bridge.Contract.Resolve(&_Bridge.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeCallerSession) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _Bridge.Contract.Resolve(&_Bridge.CallOpts, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_Bridge *BridgeCaller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string) (common.Address, error) { +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeCaller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _Bridge.contract.Call(opts, &out, "resolve0", chainId, name) + err := _Bridge.contract.Call(opts, &out, "resolve0", chainId, name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -522,39 +553,18 @@ func (_Bridge *BridgeCaller) Resolve0(opts *bind.CallOpts, chainId *big.Int, nam } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_Bridge *BridgeSession) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _Bridge.Contract.Resolve0(&_Bridge.CallOpts, chainId, name) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeSession) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _Bridge.Contract.Resolve0(&_Bridge.CallOpts, chainId, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_Bridge *BridgeCallerSession) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _Bridge.Contract.Resolve0(&_Bridge.CallOpts, chainId, name) -} - -// EnableDestChain is a paid mutator transaction binding the contract method 0x6950f0de. -// -// Solidity: function enableDestChain(uint256 _chainId, bool enabled) returns() -func (_Bridge *BridgeTransactor) EnableDestChain(opts *bind.TransactOpts, _chainId *big.Int, enabled bool) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "enableDestChain", _chainId, enabled) -} - -// EnableDestChain is a paid mutator transaction binding the contract method 0x6950f0de. -// -// Solidity: function enableDestChain(uint256 _chainId, bool enabled) returns() -func (_Bridge *BridgeSession) EnableDestChain(_chainId *big.Int, enabled bool) (*types.Transaction, error) { - return _Bridge.Contract.EnableDestChain(&_Bridge.TransactOpts, _chainId, enabled) -} - -// EnableDestChain is a paid mutator transaction binding the contract method 0x6950f0de. -// -// Solidity: function enableDestChain(uint256 _chainId, bool enabled) returns() -func (_Bridge *BridgeTransactorSession) EnableDestChain(_chainId *big.Int, enabled bool) (*types.Transaction, error) { - return _Bridge.Contract.EnableDestChain(&_Bridge.TransactOpts, _chainId, enabled) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_Bridge *BridgeCallerSession) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _Bridge.Contract.Resolve0(&_Bridge.CallOpts, chainId, name, allowZeroAddress) } // Init is a paid mutator transaction binding the contract method 0x19ab453c. @@ -599,6 +609,27 @@ func (_Bridge *BridgeTransactorSession) ProcessMessage(message IBridgeMessage, p return _Bridge.Contract.ProcessMessage(&_Bridge.TransactOpts, message, proof) } +// ReleaseEther is a paid mutator transaction binding the contract method 0xbac443e2. +// +// Solidity: function releaseEther((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message, bytes proof) returns() +func (_Bridge *BridgeTransactor) ReleaseEther(opts *bind.TransactOpts, message IBridgeMessage, proof []byte) (*types.Transaction, error) { + return _Bridge.contract.Transact(opts, "releaseEther", message, proof) +} + +// ReleaseEther is a paid mutator transaction binding the contract method 0xbac443e2. +// +// Solidity: function releaseEther((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message, bytes proof) returns() +func (_Bridge *BridgeSession) ReleaseEther(message IBridgeMessage, proof []byte) (*types.Transaction, error) { + return _Bridge.Contract.ReleaseEther(&_Bridge.TransactOpts, message, proof) +} + +// ReleaseEther is a paid mutator transaction binding the contract method 0xbac443e2. +// +// Solidity: function releaseEther((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message, bytes proof) returns() +func (_Bridge *BridgeTransactorSession) ReleaseEther(message IBridgeMessage, proof []byte) (*types.Transaction, error) { + return _Bridge.Contract.ReleaseEther(&_Bridge.TransactOpts, message, proof) +} + // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. // // Solidity: function renounceOwnership() returns() @@ -643,46 +674,25 @@ func (_Bridge *BridgeTransactorSession) RetryMessage(message IBridgeMessage, isL // SendMessage is a paid mutator transaction binding the contract method 0x96e17852. // -// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 signal) +// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 msgHash) func (_Bridge *BridgeTransactor) SendMessage(opts *bind.TransactOpts, message IBridgeMessage) (*types.Transaction, error) { return _Bridge.contract.Transact(opts, "sendMessage", message) } // SendMessage is a paid mutator transaction binding the contract method 0x96e17852. // -// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 signal) +// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 msgHash) func (_Bridge *BridgeSession) SendMessage(message IBridgeMessage) (*types.Transaction, error) { return _Bridge.Contract.SendMessage(&_Bridge.TransactOpts, message) } // SendMessage is a paid mutator transaction binding the contract method 0x96e17852. // -// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 signal) +// Solidity: function sendMessage((uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) payable returns(bytes32 msgHash) func (_Bridge *BridgeTransactorSession) SendMessage(message IBridgeMessage) (*types.Transaction, error) { return _Bridge.Contract.SendMessage(&_Bridge.TransactOpts, message) } -// SendSignal is a paid mutator transaction binding the contract method 0x66ca2bc0. -// -// Solidity: function sendSignal(bytes32 signal) returns() -func (_Bridge *BridgeTransactor) SendSignal(opts *bind.TransactOpts, signal [32]byte) (*types.Transaction, error) { - return _Bridge.contract.Transact(opts, "sendSignal", signal) -} - -// SendSignal is a paid mutator transaction binding the contract method 0x66ca2bc0. -// -// Solidity: function sendSignal(bytes32 signal) returns() -func (_Bridge *BridgeSession) SendSignal(signal [32]byte) (*types.Transaction, error) { - return _Bridge.Contract.SendSignal(&_Bridge.TransactOpts, signal) -} - -// SendSignal is a paid mutator transaction binding the contract method 0x66ca2bc0. -// -// Solidity: function sendSignal(bytes32 signal) returns() -func (_Bridge *BridgeTransactorSession) SendSignal(signal [32]byte) (*types.Transaction, error) { - return _Bridge.Contract.SendSignal(&_Bridge.TransactOpts, signal) -} - // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() @@ -870,6 +880,152 @@ func (_Bridge *BridgeFilterer) ParseDestChainEnabled(log types.Log) (*BridgeDest return event, nil } +// BridgeEtherReleasedIterator is returned from FilterEtherReleased and is used to iterate over the raw logs and unpacked data for EtherReleased events raised by the Bridge contract. +type BridgeEtherReleasedIterator struct { + Event *BridgeEtherReleased // Event containing the contract specifics and raw log + + contract *bind.BoundContract // Generic contract to use for unpacking event data + event string // Event name to use for unpacking event data + + logs chan types.Log // Log channel receiving the found contract events + sub ethereum.Subscription // Subscription for errors, completion and termination + done bool // Whether the subscription completed delivering logs + fail error // Occurred error to stop iteration +} + +// Next advances the iterator to the subsequent event, returning whether there +// are any more events found. In case of a retrieval or parsing error, false is +// returned and Error() can be queried for the exact failure. +func (it *BridgeEtherReleasedIterator) Next() bool { + // If the iterator failed, stop iterating + if it.fail != nil { + return false + } + // If the iterator completed, deliver directly whatever's available + if it.done { + select { + case log := <-it.logs: + it.Event = new(BridgeEtherReleased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + default: + return false + } + } + // Iterator still in progress, wait for either a data or an error event + select { + case log := <-it.logs: + it.Event = new(BridgeEtherReleased) + if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { + it.fail = err + return false + } + it.Event.Raw = log + return true + + case err := <-it.sub.Err(): + it.done = true + it.fail = err + return it.Next() + } +} + +// Error returns any retrieval or parsing error occurred during filtering. +func (it *BridgeEtherReleasedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BridgeEtherReleasedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BridgeEtherReleased represents a EtherReleased event raised by the Bridge contract. +type BridgeEtherReleased struct { + MsgHash [32]byte + To common.Address + Amount *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterEtherReleased is a free log retrieval operation binding the contract event 0xea00c741e39d1d9ab1c6703152d71f9da09a782ed4ae128414730dadbb9bd847. +// +// Solidity: event EtherReleased(bytes32 indexed msgHash, address to, uint256 amount) +func (_Bridge *BridgeFilterer) FilterEtherReleased(opts *bind.FilterOpts, msgHash [][32]byte) (*BridgeEtherReleasedIterator, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _Bridge.contract.FilterLogs(opts, "EtherReleased", msgHashRule) + if err != nil { + return nil, err + } + return &BridgeEtherReleasedIterator{contract: _Bridge.contract, event: "EtherReleased", logs: logs, sub: sub}, nil +} + +// WatchEtherReleased is a free log subscription operation binding the contract event 0xea00c741e39d1d9ab1c6703152d71f9da09a782ed4ae128414730dadbb9bd847. +// +// Solidity: event EtherReleased(bytes32 indexed msgHash, address to, uint256 amount) +func (_Bridge *BridgeFilterer) WatchEtherReleased(opts *bind.WatchOpts, sink chan<- *BridgeEtherReleased, msgHash [][32]byte) (event.Subscription, error) { + + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) + } + + logs, sub, err := _Bridge.contract.WatchLogs(opts, "EtherReleased", msgHashRule) + if err != nil { + return nil, err + } + return event.NewSubscription(func(quit <-chan struct{}) error { + defer sub.Unsubscribe() + for { + select { + case log := <-logs: + // New log arrived, parse the event and forward to the user + event := new(BridgeEtherReleased) + if err := _Bridge.contract.UnpackLog(event, "EtherReleased", log); err != nil { + return err + } + event.Raw = log + + select { + case sink <- event: + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + case err := <-sub.Err(): + return err + case <-quit: + return nil + } + } + }), nil +} + +// ParseEtherReleased is a log parse operation binding the contract event 0xea00c741e39d1d9ab1c6703152d71f9da09a782ed4ae128414730dadbb9bd847. +// +// Solidity: event EtherReleased(bytes32 indexed msgHash, address to, uint256 amount) +func (_Bridge *BridgeFilterer) ParseEtherReleased(log types.Log) (*BridgeEtherReleased, error) { + event := new(BridgeEtherReleased) + if err := _Bridge.contract.UnpackLog(event, "EtherReleased", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BridgeInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the Bridge contract. type BridgeInitializedIterator struct { Event *BridgeInitialized // Event containing the contract specifics and raw log @@ -1073,22 +1229,22 @@ func (it *BridgeMessageSentIterator) Close() error { // BridgeMessageSent represents a MessageSent event raised by the Bridge contract. type BridgeMessageSent struct { - Signal [32]byte + MsgHash [32]byte Message IBridgeMessage Raw types.Log // Blockchain specific contextual infos } // FilterMessageSent is a free log retrieval operation binding the contract event 0x47866f7dacd4a276245be6ed543cae03c9c17eb17e6980cee28e3dd168b7f9f3. // -// Solidity: event MessageSent(bytes32 indexed signal, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) -func (_Bridge *BridgeFilterer) FilterMessageSent(opts *bind.FilterOpts, signal [][32]byte) (*BridgeMessageSentIterator, error) { +// Solidity: event MessageSent(bytes32 indexed msgHash, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) +func (_Bridge *BridgeFilterer) FilterMessageSent(opts *bind.FilterOpts, msgHash [][32]byte) (*BridgeMessageSentIterator, error) { - var signalRule []interface{} - for _, signalItem := range signal { - signalRule = append(signalRule, signalItem) + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) } - logs, sub, err := _Bridge.contract.FilterLogs(opts, "MessageSent", signalRule) + logs, sub, err := _Bridge.contract.FilterLogs(opts, "MessageSent", msgHashRule) if err != nil { return nil, err } @@ -1097,15 +1253,15 @@ func (_Bridge *BridgeFilterer) FilterMessageSent(opts *bind.FilterOpts, signal [ // WatchMessageSent is a free log subscription operation binding the contract event 0x47866f7dacd4a276245be6ed543cae03c9c17eb17e6980cee28e3dd168b7f9f3. // -// Solidity: event MessageSent(bytes32 indexed signal, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) -func (_Bridge *BridgeFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan<- *BridgeMessageSent, signal [][32]byte) (event.Subscription, error) { +// Solidity: event MessageSent(bytes32 indexed msgHash, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) +func (_Bridge *BridgeFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan<- *BridgeMessageSent, msgHash [][32]byte) (event.Subscription, error) { - var signalRule []interface{} - for _, signalItem := range signal { - signalRule = append(signalRule, signalItem) + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) } - logs, sub, err := _Bridge.contract.WatchLogs(opts, "MessageSent", signalRule) + logs, sub, err := _Bridge.contract.WatchLogs(opts, "MessageSent", msgHashRule) if err != nil { return nil, err } @@ -1139,7 +1295,7 @@ func (_Bridge *BridgeFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan< // ParseMessageSent is a log parse operation binding the contract event 0x47866f7dacd4a276245be6ed543cae03c9c17eb17e6980cee28e3dd168b7f9f3. // -// Solidity: event MessageSent(bytes32 indexed signal, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) +// Solidity: event MessageSent(bytes32 indexed msgHash, (uint256,address,uint256,uint256,address,address,address,uint256,uint256,uint256,uint256,bytes,string) message) func (_Bridge *BridgeFilterer) ParseMessageSent(log types.Log) (*BridgeMessageSent, error) { event := new(BridgeMessageSent) if err := _Bridge.contract.UnpackLog(event, "MessageSent", log); err != nil { @@ -1218,22 +1374,22 @@ func (it *BridgeMessageStatusChangedIterator) Close() error { // BridgeMessageStatusChanged represents a MessageStatusChanged event raised by the Bridge contract. type BridgeMessageStatusChanged struct { - Signal [32]byte - Status uint8 - Raw types.Log // Blockchain specific contextual infos + MsgHash [32]byte + Status uint8 + Raw types.Log // Blockchain specific contextual infos } // FilterMessageStatusChanged is a free log retrieval operation binding the contract event 0x6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b2575634. // -// Solidity: event MessageStatusChanged(bytes32 indexed signal, uint8 status) -func (_Bridge *BridgeFilterer) FilterMessageStatusChanged(opts *bind.FilterOpts, signal [][32]byte) (*BridgeMessageStatusChangedIterator, error) { +// Solidity: event MessageStatusChanged(bytes32 indexed msgHash, uint8 status) +func (_Bridge *BridgeFilterer) FilterMessageStatusChanged(opts *bind.FilterOpts, msgHash [][32]byte) (*BridgeMessageStatusChangedIterator, error) { - var signalRule []interface{} - for _, signalItem := range signal { - signalRule = append(signalRule, signalItem) + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) } - logs, sub, err := _Bridge.contract.FilterLogs(opts, "MessageStatusChanged", signalRule) + logs, sub, err := _Bridge.contract.FilterLogs(opts, "MessageStatusChanged", msgHashRule) if err != nil { return nil, err } @@ -1242,15 +1398,15 @@ func (_Bridge *BridgeFilterer) FilterMessageStatusChanged(opts *bind.FilterOpts, // WatchMessageStatusChanged is a free log subscription operation binding the contract event 0x6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b2575634. // -// Solidity: event MessageStatusChanged(bytes32 indexed signal, uint8 status) -func (_Bridge *BridgeFilterer) WatchMessageStatusChanged(opts *bind.WatchOpts, sink chan<- *BridgeMessageStatusChanged, signal [][32]byte) (event.Subscription, error) { +// Solidity: event MessageStatusChanged(bytes32 indexed msgHash, uint8 status) +func (_Bridge *BridgeFilterer) WatchMessageStatusChanged(opts *bind.WatchOpts, sink chan<- *BridgeMessageStatusChanged, msgHash [][32]byte) (event.Subscription, error) { - var signalRule []interface{} - for _, signalItem := range signal { - signalRule = append(signalRule, signalItem) + var msgHashRule []interface{} + for _, msgHashItem := range msgHash { + msgHashRule = append(msgHashRule, msgHashItem) } - logs, sub, err := _Bridge.contract.WatchLogs(opts, "MessageStatusChanged", signalRule) + logs, sub, err := _Bridge.contract.WatchLogs(opts, "MessageStatusChanged", msgHashRule) if err != nil { return nil, err } @@ -1284,7 +1440,7 @@ func (_Bridge *BridgeFilterer) WatchMessageStatusChanged(opts *bind.WatchOpts, s // ParseMessageStatusChanged is a log parse operation binding the contract event 0x6c51882bc2ed67617f77a1e9b9a25d2caad8448647ecb093b357a603b2575634. // -// Solidity: event MessageStatusChanged(bytes32 indexed signal, uint8 status) +// Solidity: event MessageStatusChanged(bytes32 indexed msgHash, uint8 status) func (_Bridge *BridgeFilterer) ParseMessageStatusChanged(log types.Log) (*BridgeMessageStatusChanged, error) { event := new(BridgeMessageStatusChanged) if err := _Bridge.contract.UnpackLog(event, "MessageStatusChanged", log); err != nil { @@ -1516,14 +1672,14 @@ func (it *BridgeSignalSentIterator) Close() error { // BridgeSignalSent represents a SignalSent event raised by the Bridge contract. type BridgeSignalSent struct { - Sender common.Address - Signal [32]byte - Raw types.Log // Blockchain specific contextual infos + Sender common.Address + MsgHash [32]byte + Raw types.Log // Blockchain specific contextual infos } // FilterSignalSent is a free log retrieval operation binding the contract event 0xf0958489d2a32db2b0faf27a72a31fdf28f2636ca5532f1b077ddc2f51b20d1d. // -// Solidity: event SignalSent(address sender, bytes32 signal) +// Solidity: event SignalSent(address sender, bytes32 msgHash) func (_Bridge *BridgeFilterer) FilterSignalSent(opts *bind.FilterOpts) (*BridgeSignalSentIterator, error) { logs, sub, err := _Bridge.contract.FilterLogs(opts, "SignalSent") @@ -1535,7 +1691,7 @@ func (_Bridge *BridgeFilterer) FilterSignalSent(opts *bind.FilterOpts) (*BridgeS // WatchSignalSent is a free log subscription operation binding the contract event 0xf0958489d2a32db2b0faf27a72a31fdf28f2636ca5532f1b077ddc2f51b20d1d. // -// Solidity: event SignalSent(address sender, bytes32 signal) +// Solidity: event SignalSent(address sender, bytes32 msgHash) func (_Bridge *BridgeFilterer) WatchSignalSent(opts *bind.WatchOpts, sink chan<- *BridgeSignalSent) (event.Subscription, error) { logs, sub, err := _Bridge.contract.WatchLogs(opts, "SignalSent") @@ -1572,7 +1728,7 @@ func (_Bridge *BridgeFilterer) WatchSignalSent(opts *bind.WatchOpts, sink chan<- // ParseSignalSent is a log parse operation binding the contract event 0xf0958489d2a32db2b0faf27a72a31fdf28f2636ca5532f1b077ddc2f51b20d1d. // -// Solidity: event SignalSent(address sender, bytes32 signal) +// Solidity: event SignalSent(address sender, bytes32 msgHash) func (_Bridge *BridgeFilterer) ParseSignalSent(log types.Log) (*BridgeSignalSent, error) { event := new(BridgeSignalSent) if err := _Bridge.contract.UnpackLog(event, "SignalSent", log); err != nil { diff --git a/packages/relayer/contracts/IHeaderSync.go b/packages/relayer/contracts/iheadersync/IHeaderSync.go similarity index 99% rename from packages/relayer/contracts/IHeaderSync.go rename to packages/relayer/contracts/iheadersync/IHeaderSync.go index ebc05b7318..83ee4782ad 100644 --- a/packages/relayer/contracts/IHeaderSync.go +++ b/packages/relayer/contracts/iheadersync/IHeaderSync.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package contracts +package iheadersync import ( "math/big" diff --git a/packages/relayer/contracts/TaikoL1.go b/packages/relayer/contracts/taikol1/TaikoL1.go similarity index 73% rename from packages/relayer/contracts/TaikoL1.go rename to packages/relayer/contracts/taikol1/TaikoL1.go index df384021d0..2179b474d0 100644 --- a/packages/relayer/contracts/TaikoL1.go +++ b/packages/relayer/contracts/taikol1/TaikoL1.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package contracts +package taikol1 import ( "math/big" @@ -41,13 +41,55 @@ type TaikoDataBlockMetadata struct { CommitSlot uint64 } +// TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataConfig struct { + ChainId *big.Int + MaxNumBlocks *big.Int + BlockHashHistory *big.Int + ZkProofsPerBlock *big.Int + MaxVerificationsPerTx *big.Int + CommitConfirmations *big.Int + MaxProofsPerForkChoice *big.Int + BlockMaxGasLimit *big.Int + MaxTransactionsPerBlock *big.Int + MaxBytesPerTxList *big.Int + MinTxGasLimit *big.Int + AnchorTxGasLimit *big.Int + FeePremiumLamda *big.Int + RewardBurnBips *big.Int + ProposerDepositPctg *big.Int + FeeBaseMAF *big.Int + BlockTimeMAF *big.Int + ProofTimeMAF *big.Int + RewardMultiplierPctg uint64 + FeeGracePeriodPctg uint64 + FeeMaxPeriodPctg uint64 + BlockTimeCap uint64 + ProofTimeCap uint64 + BootstrapDiscountHalvingPeriod uint64 + InitialUncleDelay uint64 + EnableTokenomics bool + EnablePublicInputsCheck bool + EnableProofValidation bool +} + +// TaikoDataForkChoice is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataForkChoice struct { + BlockHash [32]byte + ProvenAt uint64 + Provers []common.Address +} + // TaikoDataProposedBlock is an auto generated low-level Go binding around an user-defined struct. type TaikoDataProposedBlock struct { - MetaHash [32]byte + MetaHash [32]byte + Deposit *big.Int + Proposer common.Address + ProposedAt uint64 } // TaikoL1ABI is the input ABI used to generate the binding from. -const TaikoL1ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"halted\",\"type\":\"bool\"}],\"name\":\"Halted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"whitelisted\",\"type\":\"bool\"}],\"name\":\"ProverWhitelisted\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getBlockProvers\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConstants\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toHalt\",\"type\":\"bool\"}],\"name\":\"halt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isHalted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"isProverWhitelisted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"whitelisted\",\"type\":\"bool\"}],\"name\":\"whitelistProver\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" +const TaikoL1ABI = "[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"BlockCommitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"beneficiary\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mixHash\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"gasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"}],\"indexed\":false,\"internalType\":\"structTaikoData.BlockMetadata\",\"name\":\"meta\",\"type\":\"tuple\"}],\"name\":\"BlockProposed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"timestamp\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"prover\",\"type\":\"address\"}],\"name\":\"BlockProven\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"}],\"name\":\"BlockVerified\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"halted\",\"type\":\"bool\"}],\"name\":\"Halted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"commitSlot\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"commitBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getBlockFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feePremiumLamda\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableProofValidation\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"getForkChoice\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"blockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"address[]\",\"name\":\"provers\",\"type\":\"address[]\"}],\"internalType\":\"structTaikoData.ForkChoice\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"provenAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"name\":\"getProofReward\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"reward\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getProposedBlock\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"metaHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"deposit\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"proposer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"proposedAt\",\"type\":\"uint64\"}],\"internalType\":\"structTaikoData.ProposedBlock\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getStateVariables\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"}],\"name\":\"getUncleProofDelay\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"toHalt\",\"type\":\"bool\"}],\"name\":\"halt\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_genesisBlockHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"_feeBase\",\"type\":\"uint256\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"parentHash\",\"type\":\"bytes32\"}],\"name\":\"isBlockVerifiable\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"commitSlot\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitHeight\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"commitHash\",\"type\":\"bytes32\"}],\"name\":\"isCommitValid\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"isHalted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proposeBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"blockId\",\"type\":\"uint256\"},{\"internalType\":\"bytes[]\",\"name\":\"inputs\",\"type\":\"bytes[]\"}],\"name\":\"proveBlockInvalid\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"k\",\"type\":\"uint8\"}],\"name\":\"signWithGoldenTouch\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"r\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"s\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"state\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"genesisHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"genesisTimestamp\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedA1\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"statusBits\",\"type\":\"uint64\"},{\"internalType\":\"uint256\",\"name\":\"feeBase\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nextBlockId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"lastProposedAt\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgBlockTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__avgGasLimit\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedHeight\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"latestVerifiedId\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"avgProofTime\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"__reservedC1\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"maxBlocks\",\"type\":\"uint256\"}],\"name\":\"verifyBlocks\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]" // TaikoL1 is an auto generated Go binding around an Ethereum contract. type TaikoL1 struct { @@ -222,79 +264,97 @@ func (_TaikoL1 *TaikoL1CallerSession) AddressManager() (common.Address, error) { return _TaikoL1.Contract.AddressManager(&_TaikoL1.CallOpts) } -// GetBlockProvers is a free data retrieval call binding the contract method 0xea04adba. +// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. // -// Solidity: function getBlockProvers(uint256 id, bytes32 parentHash) view returns(address[]) -func (_TaikoL1 *TaikoL1Caller) GetBlockProvers(opts *bind.CallOpts, id *big.Int, parentHash [32]byte) ([]common.Address, error) { +// Solidity: function getBlockFee() view returns(uint256) +func (_TaikoL1 *TaikoL1Caller) GetBlockFee(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "getBlockProvers", id, parentHash) + err := _TaikoL1.contract.Call(opts, &out, "getBlockFee") if err != nil { - return *new([]common.Address), err + return *new(*big.Int), err } - out0 := *abi.ConvertType(out[0], new([]common.Address)).(*[]common.Address) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } -// GetBlockProvers is a free data retrieval call binding the contract method 0xea04adba. +// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. // -// Solidity: function getBlockProvers(uint256 id, bytes32 parentHash) view returns(address[]) -func (_TaikoL1 *TaikoL1Session) GetBlockProvers(id *big.Int, parentHash [32]byte) ([]common.Address, error) { - return _TaikoL1.Contract.GetBlockProvers(&_TaikoL1.CallOpts, id, parentHash) +// Solidity: function getBlockFee() view returns(uint256) +func (_TaikoL1 *TaikoL1Session) GetBlockFee() (*big.Int, error) { + return _TaikoL1.Contract.GetBlockFee(&_TaikoL1.CallOpts) } -// GetBlockProvers is a free data retrieval call binding the contract method 0xea04adba. +// GetBlockFee is a free data retrieval call binding the contract method 0x7baf0bc7. // -// Solidity: function getBlockProvers(uint256 id, bytes32 parentHash) view returns(address[]) -func (_TaikoL1 *TaikoL1CallerSession) GetBlockProvers(id *big.Int, parentHash [32]byte) ([]common.Address, error) { - return _TaikoL1.Contract.GetBlockProvers(&_TaikoL1.CallOpts, id, parentHash) +// Solidity: function getBlockFee() view returns(uint256) +func (_TaikoL1 *TaikoL1CallerSession) GetBlockFee() (*big.Int, error) { + return _TaikoL1.Contract.GetBlockFee(&_TaikoL1.CallOpts) } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL1 *TaikoL1Caller) GetConstants(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) +func (_TaikoL1 *TaikoL1Caller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "getConstants") + err := _TaikoL1.contract.Call(opts, &out, "getConfig") if err != nil { - return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new([32]byte), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new([4]byte), *new([32]byte), err + return *new(TaikoDataConfig), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - out4 := *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - out5 := *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - out6 := *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) - out7 := *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) - out8 := *abi.ConvertType(out[8], new([32]byte)).(*[32]byte) - out9 := *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) - out10 := *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) - out11 := *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) - out12 := *abi.ConvertType(out[12], new([4]byte)).(*[4]byte) - out13 := *abi.ConvertType(out[13], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new(TaikoDataConfig)).(*TaikoDataConfig) + + return out0, err + +} + +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. +// +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) +func (_TaikoL1 *TaikoL1Session) GetConfig() (TaikoDataConfig, error) { + return _TaikoL1.Contract.GetConfig(&_TaikoL1.CallOpts) +} + +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. +// +// Solidity: function getConfig() pure returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool)) +func (_TaikoL1 *TaikoL1CallerSession) GetConfig() (TaikoDataConfig, error) { + return _TaikoL1.Contract.GetConfig(&_TaikoL1.CallOpts) +} + +// GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. +// +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +func (_TaikoL1 *TaikoL1Caller) GetForkChoice(opts *bind.CallOpts, id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { + var out []interface{} + err := _TaikoL1.contract.Call(opts, &out, "getForkChoice", id, parentHash) - return out0, out1, out2, out3, out4, out5, out6, out7, out8, out9, out10, out11, out12, out13, err + if err != nil { + return *new(TaikoDataForkChoice), err + } + + out0 := *abi.ConvertType(out[0], new(TaikoDataForkChoice)).(*TaikoDataForkChoice) + + return out0, err } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL1 *TaikoL1Session) GetConstants() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { - return _TaikoL1.Contract.GetConstants(&_TaikoL1.CallOpts) +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +func (_TaikoL1 *TaikoL1Session) GetForkChoice(id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { + return _TaikoL1.Contract.GetForkChoice(&_TaikoL1.CallOpts, id, parentHash) } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetForkChoice is a free data retrieval call binding the contract method 0xe00ea1e1. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL1 *TaikoL1CallerSession) GetConstants() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { - return _TaikoL1.Contract.GetConstants(&_TaikoL1.CallOpts) +// Solidity: function getForkChoice(uint256 id, bytes32 parentHash) view returns((bytes32,uint64,address[])) +func (_TaikoL1 *TaikoL1CallerSession) GetForkChoice(id *big.Int, parentHash [32]byte) (TaikoDataForkChoice, error) { + return _TaikoL1.Contract.GetForkChoice(&_TaikoL1.CallOpts, id, parentHash) } // GetLatestSyncedHeader is a free data retrieval call binding the contract method 0x5155ce9f. @@ -328,9 +388,40 @@ func (_TaikoL1 *TaikoL1CallerSession) GetLatestSyncedHeader() ([32]byte, error) return _TaikoL1.Contract.GetLatestSyncedHeader(&_TaikoL1.CallOpts) } +// GetProofReward is a free data retrieval call binding the contract method 0x4ee56f9e. +// +// Solidity: function getProofReward(uint64 provenAt, uint64 proposedAt) view returns(uint256 reward) +func (_TaikoL1 *TaikoL1Caller) GetProofReward(opts *bind.CallOpts, provenAt uint64, proposedAt uint64) (*big.Int, error) { + var out []interface{} + err := _TaikoL1.contract.Call(opts, &out, "getProofReward", provenAt, proposedAt) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetProofReward is a free data retrieval call binding the contract method 0x4ee56f9e. +// +// Solidity: function getProofReward(uint64 provenAt, uint64 proposedAt) view returns(uint256 reward) +func (_TaikoL1 *TaikoL1Session) GetProofReward(provenAt uint64, proposedAt uint64) (*big.Int, error) { + return _TaikoL1.Contract.GetProofReward(&_TaikoL1.CallOpts, provenAt, proposedAt) +} + +// GetProofReward is a free data retrieval call binding the contract method 0x4ee56f9e. +// +// Solidity: function getProofReward(uint64 provenAt, uint64 proposedAt) view returns(uint256 reward) +func (_TaikoL1 *TaikoL1CallerSession) GetProofReward(provenAt uint64, proposedAt uint64) (*big.Int, error) { + return _TaikoL1.Contract.GetProofReward(&_TaikoL1.CallOpts, provenAt, proposedAt) +} + // GetProposedBlock is a free data retrieval call binding the contract method 0x8972b10c. // -// Solidity: function getProposedBlock(uint256 id) view returns((bytes32)) +// Solidity: function getProposedBlock(uint256 id) view returns((bytes32,uint256,address,uint64)) func (_TaikoL1 *TaikoL1Caller) GetProposedBlock(opts *bind.CallOpts, id *big.Int) (TaikoDataProposedBlock, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "getProposedBlock", id) @@ -347,49 +438,55 @@ func (_TaikoL1 *TaikoL1Caller) GetProposedBlock(opts *bind.CallOpts, id *big.Int // GetProposedBlock is a free data retrieval call binding the contract method 0x8972b10c. // -// Solidity: function getProposedBlock(uint256 id) view returns((bytes32)) +// Solidity: function getProposedBlock(uint256 id) view returns((bytes32,uint256,address,uint64)) func (_TaikoL1 *TaikoL1Session) GetProposedBlock(id *big.Int) (TaikoDataProposedBlock, error) { return _TaikoL1.Contract.GetProposedBlock(&_TaikoL1.CallOpts, id) } // GetProposedBlock is a free data retrieval call binding the contract method 0x8972b10c. // -// Solidity: function getProposedBlock(uint256 id) view returns((bytes32)) +// Solidity: function getProposedBlock(uint256 id) view returns((bytes32,uint256,address,uint64)) func (_TaikoL1 *TaikoL1CallerSession) GetProposedBlock(id *big.Int) (TaikoDataProposedBlock, error) { return _TaikoL1.Contract.GetProposedBlock(&_TaikoL1.CallOpts, id) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint64) -func (_TaikoL1 *TaikoL1Caller) GetStateVariables(opts *bind.CallOpts) (uint64, uint64, uint64, uint64, error) { +// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint256, uint64, uint64, uint64, uint64, uint64, uint64) +func (_TaikoL1 *TaikoL1Caller) GetStateVariables(opts *bind.CallOpts) (uint64, uint64, uint64, *big.Int, uint64, uint64, uint64, uint64, uint64, uint64, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "getStateVariables") if err != nil { - return *new(uint64), *new(uint64), *new(uint64), *new(uint64), err + return *new(uint64), *new(uint64), *new(uint64), *new(*big.Int), *new(uint64), *new(uint64), *new(uint64), *new(uint64), *new(uint64), *new(uint64), err } out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) out1 := *abi.ConvertType(out[1], new(uint64)).(*uint64) out2 := *abi.ConvertType(out[2], new(uint64)).(*uint64) - out3 := *abi.ConvertType(out[3], new(uint64)).(*uint64) + out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) + out4 := *abi.ConvertType(out[4], new(uint64)).(*uint64) + out5 := *abi.ConvertType(out[5], new(uint64)).(*uint64) + out6 := *abi.ConvertType(out[6], new(uint64)).(*uint64) + out7 := *abi.ConvertType(out[7], new(uint64)).(*uint64) + out8 := *abi.ConvertType(out[8], new(uint64)).(*uint64) + out9 := *abi.ConvertType(out[9], new(uint64)).(*uint64) - return out0, out1, out2, out3, err + return out0, out1, out2, out3, out4, out5, out6, out7, out8, out9, err } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint64) -func (_TaikoL1 *TaikoL1Session) GetStateVariables() (uint64, uint64, uint64, uint64, error) { +// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint256, uint64, uint64, uint64, uint64, uint64, uint64) +func (_TaikoL1 *TaikoL1Session) GetStateVariables() (uint64, uint64, uint64, *big.Int, uint64, uint64, uint64, uint64, uint64, uint64, error) { return _TaikoL1.Contract.GetStateVariables(&_TaikoL1.CallOpts) } // GetStateVariables is a free data retrieval call binding the contract method 0xdde89cf5. // -// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint64) -func (_TaikoL1 *TaikoL1CallerSession) GetStateVariables() (uint64, uint64, uint64, uint64, error) { +// Solidity: function getStateVariables() view returns(uint64, uint64, uint64, uint256, uint64, uint64, uint64, uint64, uint64, uint64) +func (_TaikoL1 *TaikoL1CallerSession) GetStateVariables() (uint64, uint64, uint64, *big.Int, uint64, uint64, uint64, uint64, uint64, uint64, error) { return _TaikoL1.Contract.GetStateVariables(&_TaikoL1.CallOpts) } @@ -424,6 +521,68 @@ func (_TaikoL1 *TaikoL1CallerSession) GetSyncedHeader(number *big.Int) ([32]byte return _TaikoL1.Contract.GetSyncedHeader(&_TaikoL1.CallOpts, number) } +// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. +// +// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) +func (_TaikoL1 *TaikoL1Caller) GetUncleProofDelay(opts *bind.CallOpts, blockId *big.Int) (uint64, error) { + var out []interface{} + err := _TaikoL1.contract.Call(opts, &out, "getUncleProofDelay", blockId) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. +// +// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) +func (_TaikoL1 *TaikoL1Session) GetUncleProofDelay(blockId *big.Int) (uint64, error) { + return _TaikoL1.Contract.GetUncleProofDelay(&_TaikoL1.CallOpts, blockId) +} + +// GetUncleProofDelay is a free data retrieval call binding the contract method 0xf728abaf. +// +// Solidity: function getUncleProofDelay(uint256 blockId) view returns(uint64) +func (_TaikoL1 *TaikoL1CallerSession) GetUncleProofDelay(blockId *big.Int) (uint64, error) { + return _TaikoL1.Contract.GetUncleProofDelay(&_TaikoL1.CallOpts, blockId) +} + +// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. +// +// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) +func (_TaikoL1 *TaikoL1Caller) IsBlockVerifiable(opts *bind.CallOpts, blockId *big.Int, parentHash [32]byte) (bool, error) { + var out []interface{} + err := _TaikoL1.contract.Call(opts, &out, "isBlockVerifiable", blockId, parentHash) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. +// +// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) +func (_TaikoL1 *TaikoL1Session) IsBlockVerifiable(blockId *big.Int, parentHash [32]byte) (bool, error) { + return _TaikoL1.Contract.IsBlockVerifiable(&_TaikoL1.CallOpts, blockId, parentHash) +} + +// IsBlockVerifiable is a free data retrieval call binding the contract method 0x46a06c27. +// +// Solidity: function isBlockVerifiable(uint256 blockId, bytes32 parentHash) view returns(bool) +func (_TaikoL1 *TaikoL1CallerSession) IsBlockVerifiable(blockId *big.Int, parentHash [32]byte) (bool, error) { + return _TaikoL1.Contract.IsBlockVerifiable(&_TaikoL1.CallOpts, blockId, parentHash) +} + // IsCommitValid is a free data retrieval call binding the contract method 0x340d9599. // // Solidity: function isCommitValid(uint256 commitSlot, uint256 commitHeight, bytes32 commitHash) view returns(bool) @@ -486,37 +645,6 @@ func (_TaikoL1 *TaikoL1CallerSession) IsHalted() (bool, error) { return _TaikoL1.Contract.IsHalted(&_TaikoL1.CallOpts) } -// IsProverWhitelisted is a free data retrieval call binding the contract method 0x664d0896. -// -// Solidity: function isProverWhitelisted(address prover) view returns(bool) -func (_TaikoL1 *TaikoL1Caller) IsProverWhitelisted(opts *bind.CallOpts, prover common.Address) (bool, error) { - var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "isProverWhitelisted", prover) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// IsProverWhitelisted is a free data retrieval call binding the contract method 0x664d0896. -// -// Solidity: function isProverWhitelisted(address prover) view returns(bool) -func (_TaikoL1 *TaikoL1Session) IsProverWhitelisted(prover common.Address) (bool, error) { - return _TaikoL1.Contract.IsProverWhitelisted(&_TaikoL1.CallOpts, prover) -} - -// IsProverWhitelisted is a free data retrieval call binding the contract method 0x664d0896. -// -// Solidity: function isProverWhitelisted(address prover) view returns(bool) -func (_TaikoL1 *TaikoL1CallerSession) IsProverWhitelisted(prover common.Address) (bool, error) { - return _TaikoL1.Contract.IsProverWhitelisted(&_TaikoL1.CallOpts, prover) -} - // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. // // Solidity: function owner() view returns(address) @@ -548,12 +676,12 @@ func (_TaikoL1 *TaikoL1CallerSession) Owner() (common.Address, error) { return _TaikoL1.Contract.Owner(&_TaikoL1.CallOpts) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL1 *TaikoL1Caller) Resolve(opts *bind.CallOpts, name string) (common.Address, error) { +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1Caller) Resolve(opts *bind.CallOpts, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "resolve", name) + err := _TaikoL1.contract.Call(opts, &out, "resolve", name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -565,26 +693,26 @@ func (_TaikoL1 *TaikoL1Caller) Resolve(opts *bind.CallOpts, name string) (common } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL1 *TaikoL1Session) Resolve(name string) (common.Address, error) { - return _TaikoL1.Contract.Resolve(&_TaikoL1.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1Session) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1.Contract.Resolve(&_TaikoL1.CallOpts, name, allowZeroAddress) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL1 *TaikoL1CallerSession) Resolve(name string) (common.Address, error) { - return _TaikoL1.Contract.Resolve(&_TaikoL1.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1CallerSession) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1.Contract.Resolve(&_TaikoL1.CallOpts, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL1 *TaikoL1Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string) (common.Address, error) { +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _TaikoL1.contract.Call(opts, &out, "resolve0", chainId, name) + err := _TaikoL1.contract.Call(opts, &out, "resolve0", chainId, name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -596,18 +724,18 @@ func (_TaikoL1 *TaikoL1Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, n } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL1 *TaikoL1Session) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _TaikoL1.Contract.Resolve0(&_TaikoL1.CallOpts, chainId, name) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1Session) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1.Contract.Resolve0(&_TaikoL1.CallOpts, chainId, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL1 *TaikoL1CallerSession) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _TaikoL1.Contract.Resolve0(&_TaikoL1.CallOpts, chainId, name) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL1 *TaikoL1CallerSession) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL1.Contract.Resolve0(&_TaikoL1.CallOpts, chainId, name, allowZeroAddress) } // SignWithGoldenTouch is a free data retrieval call binding the contract method 0xdadec12a. @@ -662,33 +790,57 @@ func (_TaikoL1 *TaikoL1CallerSession) SignWithGoldenTouch(hash [32]byte, k uint8 // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 statusBits, uint64 genesisHeight, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 nextBlockId) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1Caller) State(opts *bind.CallOpts) (struct { - StatusBits uint64 GenesisHeight uint64 + GenesisTimestamp uint64 + ReservedA1 uint64 + StatusBits uint64 + FeeBase *big.Int + NextBlockId uint64 + LastProposedAt uint64 + AvgBlockTime uint64 + AvgGasLimit uint64 LatestVerifiedHeight uint64 LatestVerifiedId uint64 - NextBlockId uint64 + AvgProofTime uint64 + ReservedC1 uint64 }, error) { var out []interface{} err := _TaikoL1.contract.Call(opts, &out, "state") outstruct := new(struct { - StatusBits uint64 GenesisHeight uint64 + GenesisTimestamp uint64 + ReservedA1 uint64 + StatusBits uint64 + FeeBase *big.Int + NextBlockId uint64 + LastProposedAt uint64 + AvgBlockTime uint64 + AvgGasLimit uint64 LatestVerifiedHeight uint64 LatestVerifiedId uint64 - NextBlockId uint64 + AvgProofTime uint64 + ReservedC1 uint64 }) if err != nil { return *outstruct, err } - outstruct.StatusBits = *abi.ConvertType(out[0], new(uint64)).(*uint64) - outstruct.GenesisHeight = *abi.ConvertType(out[1], new(uint64)).(*uint64) - outstruct.LatestVerifiedHeight = *abi.ConvertType(out[2], new(uint64)).(*uint64) - outstruct.LatestVerifiedId = *abi.ConvertType(out[3], new(uint64)).(*uint64) - outstruct.NextBlockId = *abi.ConvertType(out[4], new(uint64)).(*uint64) + outstruct.GenesisHeight = *abi.ConvertType(out[0], new(uint64)).(*uint64) + outstruct.GenesisTimestamp = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.ReservedA1 = *abi.ConvertType(out[2], new(uint64)).(*uint64) + outstruct.StatusBits = *abi.ConvertType(out[3], new(uint64)).(*uint64) + outstruct.FeeBase = *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) + outstruct.NextBlockId = *abi.ConvertType(out[5], new(uint64)).(*uint64) + outstruct.LastProposedAt = *abi.ConvertType(out[6], new(uint64)).(*uint64) + outstruct.AvgBlockTime = *abi.ConvertType(out[7], new(uint64)).(*uint64) + outstruct.AvgGasLimit = *abi.ConvertType(out[8], new(uint64)).(*uint64) + outstruct.LatestVerifiedHeight = *abi.ConvertType(out[9], new(uint64)).(*uint64) + outstruct.LatestVerifiedId = *abi.ConvertType(out[10], new(uint64)).(*uint64) + outstruct.AvgProofTime = *abi.ConvertType(out[11], new(uint64)).(*uint64) + outstruct.ReservedC1 = *abi.ConvertType(out[12], new(uint64)).(*uint64) return *outstruct, err @@ -696,26 +848,42 @@ func (_TaikoL1 *TaikoL1Caller) State(opts *bind.CallOpts) (struct { // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 statusBits, uint64 genesisHeight, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 nextBlockId) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1Session) State() (struct { - StatusBits uint64 GenesisHeight uint64 + GenesisTimestamp uint64 + ReservedA1 uint64 + StatusBits uint64 + FeeBase *big.Int + NextBlockId uint64 + LastProposedAt uint64 + AvgBlockTime uint64 + AvgGasLimit uint64 LatestVerifiedHeight uint64 LatestVerifiedId uint64 - NextBlockId uint64 + AvgProofTime uint64 + ReservedC1 uint64 }, error) { return _TaikoL1.Contract.State(&_TaikoL1.CallOpts) } // State is a free data retrieval call binding the contract method 0xc19d93fb. // -// Solidity: function state() view returns(uint64 statusBits, uint64 genesisHeight, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 nextBlockId) +// Solidity: function state() view returns(uint64 genesisHeight, uint64 genesisTimestamp, uint64 __reservedA1, uint64 statusBits, uint256 feeBase, uint64 nextBlockId, uint64 lastProposedAt, uint64 avgBlockTime, uint64 __avgGasLimit, uint64 latestVerifiedHeight, uint64 latestVerifiedId, uint64 avgProofTime, uint64 __reservedC1) func (_TaikoL1 *TaikoL1CallerSession) State() (struct { - StatusBits uint64 GenesisHeight uint64 + GenesisTimestamp uint64 + ReservedA1 uint64 + StatusBits uint64 + FeeBase *big.Int + NextBlockId uint64 + LastProposedAt uint64 + AvgBlockTime uint64 + AvgGasLimit uint64 LatestVerifiedHeight uint64 LatestVerifiedId uint64 - NextBlockId uint64 + AvgProofTime uint64 + ReservedC1 uint64 }, error) { return _TaikoL1.Contract.State(&_TaikoL1.CallOpts) } @@ -762,25 +930,25 @@ func (_TaikoL1 *TaikoL1TransactorSession) Halt(toHalt bool) (*types.Transaction, return _TaikoL1.Contract.Halt(&_TaikoL1.TransactOpts, toHalt) } -// Init is a paid mutator transaction binding the contract method 0x2cc0b254. +// Init is a paid mutator transaction binding the contract method 0x9c5e9f06. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() -func (_TaikoL1 *TaikoL1Transactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { - return _TaikoL1.contract.Transact(opts, "init", _addressManager, _genesisBlockHash) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint256 _feeBase) returns() +func (_TaikoL1 *TaikoL1Transactor) Init(opts *bind.TransactOpts, _addressManager common.Address, _genesisBlockHash [32]byte, _feeBase *big.Int) (*types.Transaction, error) { + return _TaikoL1.contract.Transact(opts, "init", _addressManager, _genesisBlockHash, _feeBase) } -// Init is a paid mutator transaction binding the contract method 0x2cc0b254. +// Init is a paid mutator transaction binding the contract method 0x9c5e9f06. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() -func (_TaikoL1 *TaikoL1Session) Init(_addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.Init(&_TaikoL1.TransactOpts, _addressManager, _genesisBlockHash) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint256 _feeBase) returns() +func (_TaikoL1 *TaikoL1Session) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _feeBase *big.Int) (*types.Transaction, error) { + return _TaikoL1.Contract.Init(&_TaikoL1.TransactOpts, _addressManager, _genesisBlockHash, _feeBase) } -// Init is a paid mutator transaction binding the contract method 0x2cc0b254. +// Init is a paid mutator transaction binding the contract method 0x9c5e9f06. // -// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash) returns() -func (_TaikoL1 *TaikoL1TransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.Init(&_TaikoL1.TransactOpts, _addressManager, _genesisBlockHash) +// Solidity: function init(address _addressManager, bytes32 _genesisBlockHash, uint256 _feeBase) returns() +func (_TaikoL1 *TaikoL1TransactorSession) Init(_addressManager common.Address, _genesisBlockHash [32]byte, _feeBase *big.Int) (*types.Transaction, error) { + return _TaikoL1.Contract.Init(&_TaikoL1.TransactOpts, _addressManager, _genesisBlockHash, _feeBase) } // ProposeBlock is a paid mutator transaction binding the contract method 0xa043dbdf. @@ -806,44 +974,44 @@ func (_TaikoL1 *TaikoL1TransactorSession) ProposeBlock(inputs [][]byte) (*types. // ProveBlock is a paid mutator transaction binding the contract method 0x8ed7b3be. // -// Solidity: function proveBlock(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1Transactor) ProveBlock(opts *bind.TransactOpts, blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.contract.Transact(opts, "proveBlock", blockIndex, inputs) +// Solidity: function proveBlock(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1Transactor) ProveBlock(opts *bind.TransactOpts, blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.contract.Transact(opts, "proveBlock", blockId, inputs) } // ProveBlock is a paid mutator transaction binding the contract method 0x8ed7b3be. // -// Solidity: function proveBlock(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1Session) ProveBlock(blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.ProveBlock(&_TaikoL1.TransactOpts, blockIndex, inputs) +// Solidity: function proveBlock(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1Session) ProveBlock(blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.Contract.ProveBlock(&_TaikoL1.TransactOpts, blockId, inputs) } // ProveBlock is a paid mutator transaction binding the contract method 0x8ed7b3be. // -// Solidity: function proveBlock(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1TransactorSession) ProveBlock(blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.ProveBlock(&_TaikoL1.TransactOpts, blockIndex, inputs) +// Solidity: function proveBlock(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1TransactorSession) ProveBlock(blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.Contract.ProveBlock(&_TaikoL1.TransactOpts, blockId, inputs) } // ProveBlockInvalid is a paid mutator transaction binding the contract method 0xa279cec7. // -// Solidity: function proveBlockInvalid(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1Transactor) ProveBlockInvalid(opts *bind.TransactOpts, blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.contract.Transact(opts, "proveBlockInvalid", blockIndex, inputs) +// Solidity: function proveBlockInvalid(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1Transactor) ProveBlockInvalid(opts *bind.TransactOpts, blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.contract.Transact(opts, "proveBlockInvalid", blockId, inputs) } // ProveBlockInvalid is a paid mutator transaction binding the contract method 0xa279cec7. // -// Solidity: function proveBlockInvalid(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1Session) ProveBlockInvalid(blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.ProveBlockInvalid(&_TaikoL1.TransactOpts, blockIndex, inputs) +// Solidity: function proveBlockInvalid(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1Session) ProveBlockInvalid(blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.Contract.ProveBlockInvalid(&_TaikoL1.TransactOpts, blockId, inputs) } // ProveBlockInvalid is a paid mutator transaction binding the contract method 0xa279cec7. // -// Solidity: function proveBlockInvalid(uint256 blockIndex, bytes[] inputs) returns() -func (_TaikoL1 *TaikoL1TransactorSession) ProveBlockInvalid(blockIndex *big.Int, inputs [][]byte) (*types.Transaction, error) { - return _TaikoL1.Contract.ProveBlockInvalid(&_TaikoL1.TransactOpts, blockIndex, inputs) +// Solidity: function proveBlockInvalid(uint256 blockId, bytes[] inputs) returns() +func (_TaikoL1 *TaikoL1TransactorSession) ProveBlockInvalid(blockId *big.Int, inputs [][]byte) (*types.Transaction, error) { + return _TaikoL1.Contract.ProveBlockInvalid(&_TaikoL1.TransactOpts, blockId, inputs) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -909,27 +1077,6 @@ func (_TaikoL1 *TaikoL1TransactorSession) VerifyBlocks(maxBlocks *big.Int) (*typ return _TaikoL1.Contract.VerifyBlocks(&_TaikoL1.TransactOpts, maxBlocks) } -// WhitelistProver is a paid mutator transaction binding the contract method 0xa28088ea. -// -// Solidity: function whitelistProver(address prover, bool whitelisted) returns() -func (_TaikoL1 *TaikoL1Transactor) WhitelistProver(opts *bind.TransactOpts, prover common.Address, whitelisted bool) (*types.Transaction, error) { - return _TaikoL1.contract.Transact(opts, "whitelistProver", prover, whitelisted) -} - -// WhitelistProver is a paid mutator transaction binding the contract method 0xa28088ea. -// -// Solidity: function whitelistProver(address prover, bool whitelisted) returns() -func (_TaikoL1 *TaikoL1Session) WhitelistProver(prover common.Address, whitelisted bool) (*types.Transaction, error) { - return _TaikoL1.Contract.WhitelistProver(&_TaikoL1.TransactOpts, prover, whitelisted) -} - -// WhitelistProver is a paid mutator transaction binding the contract method 0xa28088ea. -// -// Solidity: function whitelistProver(address prover, bool whitelisted) returns() -func (_TaikoL1 *TaikoL1TransactorSession) WhitelistProver(prover common.Address, whitelisted bool) (*types.Transaction, error) { - return _TaikoL1.Contract.WhitelistProver(&_TaikoL1.TransactOpts, prover, whitelisted) -} - // TaikoL1BlockCommittedIterator is returned from FilterBlockCommitted and is used to iterate over the raw logs and unpacked data for BlockCommitted events raised by the TaikoL1 contract. type TaikoL1BlockCommittedIterator struct { Event *TaikoL1BlockCommitted // Event containing the contract specifics and raw log @@ -2079,148 +2226,3 @@ func (_TaikoL1 *TaikoL1Filterer) ParseOwnershipTransferred(log types.Log) (*Taik event.Raw = log return event, nil } - -// TaikoL1ProverWhitelistedIterator is returned from FilterProverWhitelisted and is used to iterate over the raw logs and unpacked data for ProverWhitelisted events raised by the TaikoL1 contract. -type TaikoL1ProverWhitelistedIterator struct { - Event *TaikoL1ProverWhitelisted // Event containing the contract specifics and raw log - - contract *bind.BoundContract // Generic contract to use for unpacking event data - event string // Event name to use for unpacking event data - - logs chan types.Log // Log channel receiving the found contract events - sub ethereum.Subscription // Subscription for errors, completion and termination - done bool // Whether the subscription completed delivering logs - fail error // Occurred error to stop iteration -} - -// Next advances the iterator to the subsequent event, returning whether there -// are any more events found. In case of a retrieval or parsing error, false is -// returned and Error() can be queried for the exact failure. -func (it *TaikoL1ProverWhitelistedIterator) Next() bool { - // If the iterator failed, stop iterating - if it.fail != nil { - return false - } - // If the iterator completed, deliver directly whatever's available - if it.done { - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverWhitelisted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - default: - return false - } - } - // Iterator still in progress, wait for either a data or an error event - select { - case log := <-it.logs: - it.Event = new(TaikoL1ProverWhitelisted) - if err := it.contract.UnpackLog(it.Event, it.event, log); err != nil { - it.fail = err - return false - } - it.Event.Raw = log - return true - - case err := <-it.sub.Err(): - it.done = true - it.fail = err - return it.Next() - } -} - -// Error returns any retrieval or parsing error occurred during filtering. -func (it *TaikoL1ProverWhitelistedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *TaikoL1ProverWhitelistedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// TaikoL1ProverWhitelisted represents a ProverWhitelisted event raised by the TaikoL1 contract. -type TaikoL1ProverWhitelisted struct { - Prover common.Address - Whitelisted bool - Raw types.Log // Blockchain specific contextual infos -} - -// FilterProverWhitelisted is a free log retrieval operation binding the contract event 0x3ab5de546d706301c6736d6e367d46508c2bd77d9fa8a52813f74fa8a0d8a424. -// -// Solidity: event ProverWhitelisted(address indexed prover, bool whitelisted) -func (_TaikoL1 *TaikoL1Filterer) FilterProverWhitelisted(opts *bind.FilterOpts, prover []common.Address) (*TaikoL1ProverWhitelistedIterator, error) { - - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) - } - - logs, sub, err := _TaikoL1.contract.FilterLogs(opts, "ProverWhitelisted", proverRule) - if err != nil { - return nil, err - } - return &TaikoL1ProverWhitelistedIterator{contract: _TaikoL1.contract, event: "ProverWhitelisted", logs: logs, sub: sub}, nil -} - -// WatchProverWhitelisted is a free log subscription operation binding the contract event 0x3ab5de546d706301c6736d6e367d46508c2bd77d9fa8a52813f74fa8a0d8a424. -// -// Solidity: event ProverWhitelisted(address indexed prover, bool whitelisted) -func (_TaikoL1 *TaikoL1Filterer) WatchProverWhitelisted(opts *bind.WatchOpts, sink chan<- *TaikoL1ProverWhitelisted, prover []common.Address) (event.Subscription, error) { - - var proverRule []interface{} - for _, proverItem := range prover { - proverRule = append(proverRule, proverItem) - } - - logs, sub, err := _TaikoL1.contract.WatchLogs(opts, "ProverWhitelisted", proverRule) - if err != nil { - return nil, err - } - return event.NewSubscription(func(quit <-chan struct{}) error { - defer sub.Unsubscribe() - for { - select { - case log := <-logs: - // New log arrived, parse the event and forward to the user - event := new(TaikoL1ProverWhitelisted) - if err := _TaikoL1.contract.UnpackLog(event, "ProverWhitelisted", log); err != nil { - return err - } - event.Raw = log - - select { - case sink <- event: - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - case err := <-sub.Err(): - return err - case <-quit: - return nil - } - } - }), nil -} - -// ParseProverWhitelisted is a log parse operation binding the contract event 0x3ab5de546d706301c6736d6e367d46508c2bd77d9fa8a52813f74fa8a0d8a424. -// -// Solidity: event ProverWhitelisted(address indexed prover, bool whitelisted) -func (_TaikoL1 *TaikoL1Filterer) ParseProverWhitelisted(log types.Log) (*TaikoL1ProverWhitelisted, error) { - event := new(TaikoL1ProverWhitelisted) - if err := _TaikoL1.contract.UnpackLog(event, "ProverWhitelisted", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} diff --git a/packages/relayer/contracts/TaikoL2.go b/packages/relayer/contracts/taikol2/TaikoL2.go similarity index 74% rename from packages/relayer/contracts/TaikoL2.go rename to packages/relayer/contracts/taikol2/TaikoL2.go index c330325194..180eeeea62 100644 --- a/packages/relayer/contracts/TaikoL2.go +++ b/packages/relayer/contracts/taikol2/TaikoL2.go @@ -1,7 +1,7 @@ // Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. -package contracts +package taikol2 import ( "math/big" @@ -26,8 +26,40 @@ var ( _ = event.NewSubscription ) +// TaikoDataConfig is an auto generated low-level Go binding around an user-defined struct. +type TaikoDataConfig struct { + ChainId *big.Int + MaxNumBlocks *big.Int + BlockHashHistory *big.Int + ZkProofsPerBlock *big.Int + MaxVerificationsPerTx *big.Int + CommitConfirmations *big.Int + MaxProofsPerForkChoice *big.Int + BlockMaxGasLimit *big.Int + MaxTransactionsPerBlock *big.Int + MaxBytesPerTxList *big.Int + MinTxGasLimit *big.Int + AnchorTxGasLimit *big.Int + FeePremiumLamda *big.Int + RewardBurnBips *big.Int + ProposerDepositPctg *big.Int + FeeBaseMAF *big.Int + BlockTimeMAF *big.Int + ProofTimeMAF *big.Int + RewardMultiplierPctg uint64 + FeeGracePeriodPctg uint64 + FeeMaxPeriodPctg uint64 + BlockTimeCap uint64 + ProofTimeCap uint64 + BootstrapDiscountHalvingPeriod uint64 + InitialUncleDelay uint64 + EnableTokenomics bool + EnablePublicInputsCheck bool + EnableProofValidation bool +} + // TaikoL2ABI is the input ABI used to generate the binding from. -const TaikoL2ABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"}],\"name\":\"BlockInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConstants\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"bytes4\",\"name\":\"\",\"type\":\"bytes4\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"},{\"internalType\":\"enumLibInvalidTxList.Reason\",\"name\":\"hint\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"txIdx\",\"type\":\"uint256\"}],\"name\":\"invalidateBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" +const TaikoL2ABI = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_addressManager\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"txListHash\",\"type\":\"bytes32\"}],\"name\":\"BlockInvalidated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"height\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"srcHeight\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"srcHash\",\"type\":\"bytes32\"}],\"name\":\"HeaderSynced\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"addressManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"l1Height\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"l1Hash\",\"type\":\"bytes32\"}],\"name\":\"anchor\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getBlockHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getConfig\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxNumBlocks\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockHashHistory\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"zkProofsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxVerificationsPerTx\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"commitConfirmations\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxProofsPerForkChoice\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockMaxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxTransactionsPerBlock\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"maxBytesPerTxList\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"minTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"anchorTxGasLimit\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feePremiumLamda\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rewardBurnBips\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proposerDepositPctg\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"feeBaseMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"blockTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"proofTimeMAF\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"rewardMultiplierPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeGracePeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"feeMaxPeriodPctg\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"blockTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"proofTimeCap\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"bootstrapDiscountHalvingPeriod\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"initialUncleDelay\",\"type\":\"uint64\"},{\"internalType\":\"bool\",\"name\":\"enableTokenomics\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enablePublicInputsCheck\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"enableProofValidation\",\"type\":\"bool\"}],\"internalType\":\"structTaikoData.Config\",\"name\":\"config\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getLatestSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"number\",\"type\":\"uint256\"}],\"name\":\"getSyncedHeader\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"txList\",\"type\":\"bytes\"},{\"internalType\":\"enumLibInvalidTxList.Reason\",\"name\":\"hint\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"txIdx\",\"type\":\"uint256\"}],\"name\":\"invalidateBlock\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"latestSyncedL1Height\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"publicInputHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"bool\",\"name\":\"allowZeroAddress\",\"type\":\"bool\"}],\"name\":\"resolve\",\"outputs\":[{\"internalType\":\"addresspayable\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]" // TaikoL2 is an auto generated Go binding around an Ethereum contract. type TaikoL2 struct { @@ -54,7 +86,7 @@ type TaikoL2Filterer struct { // TaikoL2Session is an auto generated Go binding around an Ethereum contract, // with pre-set call and transact options. type TaikoL2Session struct { - Contract *TaikoL2 // Generic contract binding to set the session for + Contract *TaikoL2 // Generic contract binding to set the session for CallOpts bind.CallOpts // Call options to use throughout this session TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } @@ -63,14 +95,14 @@ type TaikoL2Session struct { // with pre-set call options. type TaikoL2CallerSession struct { Contract *TaikoL2Caller // Generic contract caller binding to set the session for - CallOpts bind.CallOpts // Call options to use throughout this session + CallOpts bind.CallOpts // Call options to use throughout this session } // TaikoL2TransactorSession is an auto generated write-only Go binding around an Ethereum contract, // with pre-set transact options. type TaikoL2TransactorSession struct { Contract *TaikoL2Transactor // Generic contract transactor binding to set the session for - TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session } // TaikoL2Raw is an auto generated low-level Go binding around an Ethereum contract. @@ -233,48 +265,35 @@ func (_TaikoL2 *TaikoL2CallerSession) GetBlockHash(number *big.Int) ([32]byte, e return _TaikoL2.Contract.GetBlockHash(&_TaikoL2.CallOpts, number) } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL2 *TaikoL2Caller) GetConstants(opts *bind.CallOpts) (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { +// Solidity: function getConfig() view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool) config) +func (_TaikoL2 *TaikoL2Caller) GetConfig(opts *bind.CallOpts) (TaikoDataConfig, error) { var out []interface{} - err := _TaikoL2.contract.Call(opts, &out, "getConstants") + err := _TaikoL2.contract.Call(opts, &out, "getConfig") if err != nil { - return *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new([32]byte), *new(*big.Int), *new(*big.Int), *new(*big.Int), *new([4]byte), *new([32]byte), err + return *new(TaikoDataConfig), err } - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - out1 := *abi.ConvertType(out[1], new(*big.Int)).(**big.Int) - out2 := *abi.ConvertType(out[2], new(*big.Int)).(**big.Int) - out3 := *abi.ConvertType(out[3], new(*big.Int)).(**big.Int) - out4 := *abi.ConvertType(out[4], new(*big.Int)).(**big.Int) - out5 := *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - out6 := *abi.ConvertType(out[6], new(*big.Int)).(**big.Int) - out7 := *abi.ConvertType(out[7], new(*big.Int)).(**big.Int) - out8 := *abi.ConvertType(out[8], new([32]byte)).(*[32]byte) - out9 := *abi.ConvertType(out[9], new(*big.Int)).(**big.Int) - out10 := *abi.ConvertType(out[10], new(*big.Int)).(**big.Int) - out11 := *abi.ConvertType(out[11], new(*big.Int)).(**big.Int) - out12 := *abi.ConvertType(out[12], new([4]byte)).(*[4]byte) - out13 := *abi.ConvertType(out[13], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new(TaikoDataConfig)).(*TaikoDataConfig) - return out0, out1, out2, out3, out4, out5, out6, out7, out8, out9, out10, out11, out12, out13, err + return out0, err } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL2 *TaikoL2Session) GetConstants() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { - return _TaikoL2.Contract.GetConstants(&_TaikoL2.CallOpts) +// Solidity: function getConfig() view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool) config) +func (_TaikoL2 *TaikoL2Session) GetConfig() (TaikoDataConfig, error) { + return _TaikoL2.Contract.GetConfig(&_TaikoL2.CallOpts) } -// GetConstants is a free data retrieval call binding the contract method 0x9a295e73. +// GetConfig is a free data retrieval call binding the contract method 0xc3f909d4. // -// Solidity: function getConstants() pure returns(uint256, uint256, uint256, uint256, uint256, uint256, uint256, uint256, bytes32, uint256, uint256, uint256, bytes4, bytes32) -func (_TaikoL2 *TaikoL2CallerSession) GetConstants() (*big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, *big.Int, [32]byte, *big.Int, *big.Int, *big.Int, [4]byte, [32]byte, error) { - return _TaikoL2.Contract.GetConstants(&_TaikoL2.CallOpts) +// Solidity: function getConfig() view returns((uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint256,uint64,uint64,uint64,uint64,uint64,uint64,uint64,bool,bool,bool) config) +func (_TaikoL2 *TaikoL2CallerSession) GetConfig() (TaikoDataConfig, error) { + return _TaikoL2.Contract.GetConfig(&_TaikoL2.CallOpts) } // GetLatestSyncedHeader is a free data retrieval call binding the contract method 0x5155ce9f. @@ -339,35 +358,35 @@ func (_TaikoL2 *TaikoL2CallerSession) GetSyncedHeader(number *big.Int) ([32]byte return _TaikoL2.Contract.GetSyncedHeader(&_TaikoL2.CallOpts, number) } -// LatestSyncedHeader is a free data retrieval call binding the contract method 0xc8d772ab. +// LatestSyncedL1Height is a free data retrieval call binding the contract method 0xc7b96908. // -// Solidity: function latestSyncedHeader() view returns(bytes32) -func (_TaikoL2 *TaikoL2Caller) LatestSyncedHeader(opts *bind.CallOpts) ([32]byte, error) { +// Solidity: function latestSyncedL1Height() view returns(uint256) +func (_TaikoL2 *TaikoL2Caller) LatestSyncedL1Height(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _TaikoL2.contract.Call(opts, &out, "latestSyncedHeader") + err := _TaikoL2.contract.Call(opts, &out, "latestSyncedL1Height") if err != nil { - return *new([32]byte), err + return *new(*big.Int), err } - out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } -// LatestSyncedHeader is a free data retrieval call binding the contract method 0xc8d772ab. +// LatestSyncedL1Height is a free data retrieval call binding the contract method 0xc7b96908. // -// Solidity: function latestSyncedHeader() view returns(bytes32) -func (_TaikoL2 *TaikoL2Session) LatestSyncedHeader() ([32]byte, error) { - return _TaikoL2.Contract.LatestSyncedHeader(&_TaikoL2.CallOpts) +// Solidity: function latestSyncedL1Height() view returns(uint256) +func (_TaikoL2 *TaikoL2Session) LatestSyncedL1Height() (*big.Int, error) { + return _TaikoL2.Contract.LatestSyncedL1Height(&_TaikoL2.CallOpts) } -// LatestSyncedHeader is a free data retrieval call binding the contract method 0xc8d772ab. +// LatestSyncedL1Height is a free data retrieval call binding the contract method 0xc7b96908. // -// Solidity: function latestSyncedHeader() view returns(bytes32) -func (_TaikoL2 *TaikoL2CallerSession) LatestSyncedHeader() ([32]byte, error) { - return _TaikoL2.Contract.LatestSyncedHeader(&_TaikoL2.CallOpts) +// Solidity: function latestSyncedL1Height() view returns(uint256) +func (_TaikoL2 *TaikoL2CallerSession) LatestSyncedL1Height() (*big.Int, error) { + return _TaikoL2.Contract.LatestSyncedL1Height(&_TaikoL2.CallOpts) } // PublicInputHash is a free data retrieval call binding the contract method 0xdac5df78. @@ -401,12 +420,12 @@ func (_TaikoL2 *TaikoL2CallerSession) PublicInputHash() ([32]byte, error) { return _TaikoL2.Contract.PublicInputHash(&_TaikoL2.CallOpts) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL2 *TaikoL2Caller) Resolve(opts *bind.CallOpts, name string) (common.Address, error) { +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2Caller) Resolve(opts *bind.CallOpts, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _TaikoL2.contract.Call(opts, &out, "resolve", name) + err := _TaikoL2.contract.Call(opts, &out, "resolve", name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -418,26 +437,26 @@ func (_TaikoL2 *TaikoL2Caller) Resolve(opts *bind.CallOpts, name string) (common } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL2 *TaikoL2Session) Resolve(name string) (common.Address, error) { - return _TaikoL2.Contract.Resolve(&_TaikoL2.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2Session) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL2.Contract.Resolve(&_TaikoL2.CallOpts, name, allowZeroAddress) } -// Resolve is a free data retrieval call binding the contract method 0x461a4478. +// Resolve is a free data retrieval call binding the contract method 0x0ca4dffd. // -// Solidity: function resolve(string name) view returns(address) -func (_TaikoL2 *TaikoL2CallerSession) Resolve(name string) (common.Address, error) { - return _TaikoL2.Contract.Resolve(&_TaikoL2.CallOpts, name) +// Solidity: function resolve(string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2CallerSession) Resolve(name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL2.Contract.Resolve(&_TaikoL2.CallOpts, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL2 *TaikoL2Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string) (common.Address, error) { +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { var out []interface{} - err := _TaikoL2.contract.Call(opts, &out, "resolve0", chainId, name) + err := _TaikoL2.contract.Call(opts, &out, "resolve0", chainId, name, allowZeroAddress) if err != nil { return *new(common.Address), err @@ -449,18 +468,18 @@ func (_TaikoL2 *TaikoL2Caller) Resolve0(opts *bind.CallOpts, chainId *big.Int, n } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL2 *TaikoL2Session) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _TaikoL2.Contract.Resolve0(&_TaikoL2.CallOpts, chainId, name) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2Session) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL2.Contract.Resolve0(&_TaikoL2.CallOpts, chainId, name, allowZeroAddress) } -// Resolve0 is a free data retrieval call binding the contract method 0xf16c7934. +// Resolve0 is a free data retrieval call binding the contract method 0x1be2bfa7. // -// Solidity: function resolve(uint256 chainId, string name) view returns(address) -func (_TaikoL2 *TaikoL2CallerSession) Resolve0(chainId *big.Int, name string) (common.Address, error) { - return _TaikoL2.Contract.Resolve0(&_TaikoL2.CallOpts, chainId, name) +// Solidity: function resolve(uint256 chainId, string name, bool allowZeroAddress) view returns(address) +func (_TaikoL2 *TaikoL2CallerSession) Resolve0(chainId *big.Int, name string, allowZeroAddress bool) (common.Address, error) { + return _TaikoL2.Contract.Resolve0(&_TaikoL2.CallOpts, chainId, name, allowZeroAddress) } // Anchor is a paid mutator transaction binding the contract method 0xa0ca2d08. diff --git a/packages/relayer/indexer/handle_event.go b/packages/relayer/indexer/handle_event.go index a81b117199..18394df2ce 100644 --- a/packages/relayer/indexer/handle_event.go +++ b/packages/relayer/indexer/handle_event.go @@ -9,34 +9,34 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) // handleEvent handles an individual MessageSent event func (svc *Service) handleEvent( ctx context.Context, chainID *big.Int, - event *contracts.BridgeMessageSent, + event *bridge.BridgeMessageSent, ) error { raw := event.Raw - log.Infof("event found for signal: %v", common.Hash(event.Signal).Hex()) + log.Infof("event found for msgHash: %v", common.Hash(event.MsgHash).Hex()) // handle chain re-org by checking Removed property, no need to // return error, just continue and do not process. if raw.Removed { - log.Warnf("event signal was removed: %v", common.Hash(event.Signal).Hex()) + log.Warnf("event msgHash was removed: %v", common.Hash(event.MsgHash).Hex()) return nil } - if event.Signal == relayer.ZeroHash { - log.Warn("Zero signal found. This is unexpected. Returning early") + if event.MsgHash == relayer.ZeroHash { + log.Warn("Zero msgHash found. This is unexpected. Returning early") return nil } - eventStatus, err := svc.eventStatusFromSignal(ctx, event.Message.GasLimit, event.Signal) + eventStatus, err := svc.eventStatusFromMsgHash(ctx, event.Message.GasLimit, event.MsgHash) if err != nil { - return errors.Wrap(err, "svc.eventStatusFromSignal") + return errors.Wrap(err, "svc.eventStatusFromMsgHash") } marshaled, err := json.Marshal(event) @@ -55,7 +55,7 @@ func (svc *Service) handleEvent( } if !canProcessMessage(ctx, eventStatus, event.Message.Owner, svc.relayerAddr) { - log.Warnf("cant process signal: %v, eventStatus: %v", common.Hash(event.Signal).Hex(), eventStatus) + log.Warnf("cant process msgHash: %v, eventStatus: %v", common.Hash(event.MsgHash).Hex(), eventStatus) return nil } @@ -90,7 +90,7 @@ func canProcessMessage( return false } -func (svc *Service) eventStatusFromSignal( +func (svc *Service) eventStatusFromMsgHash( ctx context.Context, gasLimit *big.Int, signal [32]byte, diff --git a/packages/relayer/indexer/handle_event_test.go b/packages/relayer/indexer/handle_event_test.go index 5f39c7915b..ca209ab99c 100644 --- a/packages/relayer/indexer/handle_event_test.go +++ b/packages/relayer/indexer/handle_event_test.go @@ -74,7 +74,7 @@ func Test_canProcessMessage(t *testing.T) { } } -func Test_eventStatusFromSignal(t *testing.T) { +func Test_eventStatusFromMsgHash(t *testing.T) { tests := []struct { name string ctx context.Context @@ -95,7 +95,7 @@ func Test_eventStatusFromSignal(t *testing.T) { "eventStatusNewOnlyOwner, 0GasLimit", context.Background(), common.Big0, - mock.SuccessSignal, + mock.SuccessMsgHash, nil, relayer.EventStatusNewOnlyOwner, }, @@ -103,7 +103,7 @@ func Test_eventStatusFromSignal(t *testing.T) { "eventStatusNewOnlyOwner, nilGasLimit", context.Background(), nil, - mock.SuccessSignal, + mock.SuccessMsgHash, nil, relayer.EventStatusNewOnlyOwner, }, @@ -111,7 +111,7 @@ func Test_eventStatusFromSignal(t *testing.T) { "eventStatusNewOnlyOwner, non0GasLimit", context.Background(), big.NewInt(100), - mock.SuccessSignal, + mock.SuccessMsgHash, nil, relayer.EventStatusNew, }, @@ -121,7 +121,7 @@ func Test_eventStatusFromSignal(t *testing.T) { t.Run(tt.name, func(t *testing.T) { svc, _ := newTestService() - status, err := svc.eventStatusFromSignal(tt.ctx, tt.gasLimit, tt.signal) + status, err := svc.eventStatusFromMsgHash(tt.ctx, tt.gasLimit, tt.signal) if tt.wantErr != nil { assert.EqualError(t, tt.wantErr, err.Error()) } else { diff --git a/packages/relayer/indexer/service.go b/packages/relayer/indexer/service.go index 8f4f1b824a..b5a761f605 100644 --- a/packages/relayer/indexer/service.go +++ b/packages/relayer/indexer/service.go @@ -13,7 +13,9 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/iheadersync" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/taikol1" "github.com/taikoxyz/taiko-mono/packages/relayer/message" "github.com/taikoxyz/taiko-mono/packages/relayer/proof" ) @@ -46,7 +48,7 @@ type Service struct { numGoroutines int subscriptionBackoff time.Duration - taikol1 *contracts.TaikoL1 + taikol1 *taikol1.TaikoL1 } type NewServiceOpts struct { @@ -116,12 +118,12 @@ func NewService(opts NewServiceOpts) (*Service, error) { relayerAddr := crypto.PubkeyToAddress(*publicKeyECDSA) - bridge, err := contracts.NewBridge(opts.BridgeAddress, opts.EthClient) + srcBridge, err := bridge.NewBridge(opts.BridgeAddress, opts.EthClient) if err != nil { return nil, errors.Wrap(err, "contracts.NewBridge") } - destBridge, err := contracts.NewBridge(opts.DestBridgeAddress, opts.DestEthClient) + destBridge, err := bridge.NewBridge(opts.DestBridgeAddress, opts.DestEthClient) if err != nil { return nil, errors.Wrap(err, "contracts.NewBridge") } @@ -131,14 +133,14 @@ func NewService(opts NewServiceOpts) (*Service, error) { return nil, errors.Wrap(err, "proof.New") } - destHeaderSyncer, err := contracts.NewIHeaderSync(opts.DestTaikoAddress, opts.DestEthClient) + destHeaderSyncer, err := iheadersync.NewIHeaderSync(opts.DestTaikoAddress, opts.DestEthClient) if err != nil { return nil, errors.Wrap(err, "contracts.NewTaikoL2") } - var taikoL1 *contracts.TaikoL1 + var taikoL1 *taikol1.TaikoL1 if opts.SrcTaikoAddress != ZeroAddress { - taikoL1, err = contracts.NewTaikoL1(opts.SrcTaikoAddress, opts.EthClient) + taikoL1, err = taikol1.NewTaikoL1(opts.SrcTaikoAddress, opts.EthClient) if err != nil { return nil, errors.Wrap(err, "contracts.NewTaikoL1") } @@ -168,7 +170,7 @@ func NewService(opts NewServiceOpts) (*Service, error) { ethClient: opts.EthClient, destRPC: opts.DestRPCClient, - bridge: bridge, + bridge: srcBridge, destBridge: destBridge, taikol1: taikoL1, diff --git a/packages/relayer/indexer/set_initial_processing_block_by_mode.go b/packages/relayer/indexer/set_initial_processing_block_by_mode.go index f29d831d8c..6bc3fc4ba2 100644 --- a/packages/relayer/indexer/set_initial_processing_block_by_mode.go +++ b/packages/relayer/indexer/set_initial_processing_block_by_mode.go @@ -16,7 +16,7 @@ func (svc *Service) setInitialProcessingBlockByMode( var startingBlock uint64 = 0 if svc.taikol1 != nil { - genesis, _, _, _, err := svc.taikol1.GetStateVariables(nil) + genesis, _, _, _, _, _, _, _, _, _, err := svc.taikol1.GetStateVariables(nil) if err != nil { return errors.Wrap(err, "svc.taikoL1.GetStateVariables") } diff --git a/packages/relayer/indexer/subscribe.go b/packages/relayer/indexer/subscribe.go index e48dfabd45..e4c02698a1 100644 --- a/packages/relayer/indexer/subscribe.go +++ b/packages/relayer/indexer/subscribe.go @@ -8,14 +8,14 @@ import ( "github.com/ethereum/go-ethereum/event" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) // subscribe subscribes to latest events func (svc *Service) subscribe(ctx context.Context, chainID *big.Int) error { log.Info("subscribing to new events") - sink := make(chan *contracts.BridgeMessageSent) + sink := make(chan *bridge.BridgeMessageSent) sub := event.ResubscribeErr(svc.subscriptionBackoff, func(ctx context.Context, err error) (event.Subscription, error) { if err != nil { diff --git a/packages/relayer/message/is_profitable.go b/packages/relayer/message/is_profitable.go index 75a05e9dd2..43e35241ad 100644 --- a/packages/relayer/message/is_profitable.go +++ b/packages/relayer/message/is_profitable.go @@ -7,11 +7,11 @@ import ( "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) func (p *Processor) isProfitable( - ctx context.Context, message contracts.IBridgeMessage, proof []byte) (bool, uint64, error) { + ctx context.Context, message bridge.IBridgeMessage, proof []byte) (bool, uint64, error) { processingFee := message.ProcessingFee if processingFee == nil || processingFee.Cmp(big.NewInt(0)) != 1 { diff --git a/packages/relayer/message/is_profitable_test.go b/packages/relayer/message/is_profitable_test.go index 62f915b8cd..aac1c7f5b5 100644 --- a/packages/relayer/message/is_profitable_test.go +++ b/packages/relayer/message/is_profitable_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/stretchr/testify/assert" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" "github.com/taikoxyz/taiko-mono/packages/relayer/mock" ) @@ -15,14 +15,14 @@ func Test_isProfitable(t *testing.T) { tests := []struct { name string - message contracts.IBridgeMessage + message bridge.IBridgeMessage proof []byte wantProfitable bool wantErr error }{ { "zeroProcessingFee", - contracts.IBridgeMessage{ + bridge.IBridgeMessage{ ProcessingFee: big.NewInt(0), }, nil, @@ -31,14 +31,14 @@ func Test_isProfitable(t *testing.T) { }, { "nilProcessingFee", - contracts.IBridgeMessage{}, + bridge.IBridgeMessage{}, nil, false, nil, }, { "lowProcessingFee", - contracts.IBridgeMessage{ + bridge.IBridgeMessage{ ProcessingFee: new(big.Int).Sub(mock.ProcessMessageTx.Cost(), big.NewInt(1)), DestChainId: big.NewInt(167001), }, @@ -48,7 +48,7 @@ func Test_isProfitable(t *testing.T) { }, { "profitableProcessingFee", - contracts.IBridgeMessage{ + bridge.IBridgeMessage{ ProcessingFee: new(big.Int).Add(mock.ProcessMessageTx.Cost(), big.NewInt(1)), DestChainId: big.NewInt(167001), }, diff --git a/packages/relayer/message/process_message.go b/packages/relayer/message/process_message.go index 0ba94912ff..1b5a34ef50 100644 --- a/packages/relayer/message/process_message.go +++ b/packages/relayer/message/process_message.go @@ -11,7 +11,7 @@ import ( "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) // Process prepares and calls `processMessage` on the bridge. @@ -21,7 +21,7 @@ import ( // expects func (p *Processor) ProcessMessage( ctx context.Context, - event *contracts.BridgeMessageSent, + event *bridge.BridgeMessageSent, e *relayer.Event, ) error { if event.Message.GasLimit == nil || event.Message.GasLimit.Cmp(common.Big0) == 0 { @@ -45,7 +45,7 @@ func (p *Processor) ProcessMessage( hashed := crypto.Keccak256( event.Raw.Address.Bytes(), - event.Signal[:], + event.MsgHash[:], ) key := hex.EncodeToString(hashed) @@ -56,7 +56,7 @@ func (p *Processor) ProcessMessage( event.Message.SrcChainId, event.Message.DestChainId, event.Raw.TxHash.Hex(), - common.Hash(event.Signal).Hex(), + common.Hash(event.MsgHash).Hex(), event.Message.Owner.Hex(), ) @@ -68,14 +68,14 @@ func (p *Processor) ProcessMessage( // an issue with the signal generation. received, err := p.destBridge.IsMessageReceived(&bind.CallOpts{ Context: ctx, - }, event.Signal, event.Message.SrcChainId, encodedSignalProof) + }, event.MsgHash, event.Message.SrcChainId, encodedSignalProof) if err != nil { return errors.Wrap(err, "p.destBridge.IsMessageReceived") } // message will fail when we try to process it if !received { - log.Warnf("signal %v not received on dest chain", common.Hash(event.Signal).Hex()) + log.Warnf("msgHash %v not received on dest chain", common.Hash(event.MsgHash).Hex()) return errors.New("message not received") } @@ -93,7 +93,7 @@ func (p *Processor) ProcessMessage( log.Infof("Mined tx %s", hex.EncodeToString(tx.Hash().Bytes())) - messageStatus, err := p.destBridge.GetMessageStatus(&bind.CallOpts{}, event.Signal) + messageStatus, err := p.destBridge.GetMessageStatus(&bind.CallOpts{}, event.MsgHash) if err != nil { return errors.Wrap(err, "p.destBridge.GetMessageStatus") } @@ -110,7 +110,7 @@ func (p *Processor) ProcessMessage( func (p *Processor) sendProcessMessageCall( ctx context.Context, - event *contracts.BridgeMessageSent, + event *bridge.BridgeMessageSent, proof []byte, ) (*types.Transaction, error) { auth, err := bind.NewKeyedTransactorWithChainID(p.ecdsaKey, event.Message.DestChainId) diff --git a/packages/relayer/message/process_message_test.go b/packages/relayer/message/process_message_test.go index a12158b7f0..116fc17e2f 100644 --- a/packages/relayer/message/process_message_test.go +++ b/packages/relayer/message/process_message_test.go @@ -8,7 +8,7 @@ import ( "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" "github.com/taikoxyz/taiko-mono/packages/relayer/mock" ) @@ -17,8 +17,8 @@ func Test_sendProcessMessageCall(t *testing.T) { _, err := p.sendProcessMessageCall( context.Background(), - &contracts.BridgeMessageSent{ - Message: contracts.IBridgeMessage{ + &bridge.BridgeMessageSent{ + Message: bridge.IBridgeMessage{ DestChainId: mock.MockChainID, ProcessingFee: new(big.Int).Add(mock.ProcessMessageTx.Cost(), big.NewInt(1)), }, @@ -32,8 +32,8 @@ func Test_sendProcessMessageCall(t *testing.T) { func Test_ProcessMessage_messageNotReceived(t *testing.T) { p := newTestProcessor(true) - err := p.ProcessMessage(context.Background(), &contracts.BridgeMessageSent{ - Message: contracts.IBridgeMessage{ + err := p.ProcessMessage(context.Background(), &bridge.BridgeMessageSent{ + Message: bridge.IBridgeMessage{ GasLimit: big.NewInt(1), }, }, &relayer.Event{}) @@ -43,18 +43,18 @@ func Test_ProcessMessage_messageNotReceived(t *testing.T) { func Test_ProcessMessage_gasLimit0(t *testing.T) { p := newTestProcessor(true) - err := p.ProcessMessage(context.Background(), &contracts.BridgeMessageSent{}, &relayer.Event{}) + err := p.ProcessMessage(context.Background(), &bridge.BridgeMessageSent{}, &relayer.Event{}) assert.EqualError(t, errors.New("only user can process this, gasLimit set to 0"), err.Error()) } func Test_ProcessMessage_noChainId(t *testing.T) { p := newTestProcessor(true) - err := p.ProcessMessage(context.Background(), &contracts.BridgeMessageSent{ - Message: contracts.IBridgeMessage{ + err := p.ProcessMessage(context.Background(), &bridge.BridgeMessageSent{ + Message: bridge.IBridgeMessage{ GasLimit: big.NewInt(1), }, - Signal: mock.SuccessSignal, + MsgHash: mock.SuccessMsgHash, }, &relayer.Event{}) assert.EqualError(t, err, "p.sendProcessMessageCall: bind.NewKeyedTransactorWithChainID: no chain id specified") } @@ -62,13 +62,13 @@ func Test_ProcessMessage_noChainId(t *testing.T) { func Test_ProcessMessage(t *testing.T) { p := newTestProcessor(true) - err := p.ProcessMessage(context.Background(), &contracts.BridgeMessageSent{ - Message: contracts.IBridgeMessage{ + err := p.ProcessMessage(context.Background(), &bridge.BridgeMessageSent{ + Message: bridge.IBridgeMessage{ GasLimit: big.NewInt(1), DestChainId: mock.MockChainID, ProcessingFee: big.NewInt(1000000000), }, - Signal: mock.SuccessSignal, + MsgHash: mock.SuccessMsgHash, }, &relayer.Event{}) assert.Nil( @@ -80,12 +80,12 @@ func Test_ProcessMessage(t *testing.T) { // func Test_ProcessMessage_unprofitable(t *testing.T) { // p := newTestProcessor(true) -// err := p.ProcessMessage(context.Background(), &contracts.BridgeMessageSent{ -// Message: contracts.IBridgeMessage{ +// err := p.ProcessMessage(context.Background(), &bridge.BridgeMessageSent{ +// Message: bridge.IBridgeMessage{ // GasLimit: big.NewInt(1), // DestChainId: mock.MockChainID, // }, -// Signal: mock.SuccessSignal, +// Signal: mock.SuccessMsgHash, // }, &relayer.Event{}) // assert.EqualError( diff --git a/packages/relayer/message/processor_test.go b/packages/relayer/message/processor_test.go index f3d10981d3..d6adaff980 100644 --- a/packages/relayer/message/processor_test.go +++ b/packages/relayer/message/processor_test.go @@ -9,7 +9,8 @@ import ( "github.com/ethereum/go-ethereum/ethclient" "github.com/ethereum/go-ethereum/rpc" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/iheadersync" "github.com/taikoxyz/taiko-mono/packages/relayer/mock" "github.com/taikoxyz/taiko-mono/packages/relayer/proof" "github.com/taikoxyz/taiko-mono/packages/relayer/repo" @@ -53,9 +54,9 @@ func Test_NewProcessor(t *testing.T) { RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, nil, @@ -68,9 +69,9 @@ func Test_NewProcessor(t *testing.T) { RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, }, relayer.ErrInvalidConfirmations, }, @@ -81,9 +82,9 @@ func Test_NewProcessor(t *testing.T) { ECDSAKey: &ecdsa.PrivateKey{}, RPCClient: &rpc.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoEthClient, @@ -95,10 +96,10 @@ func Test_NewProcessor(t *testing.T) { RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, Confirmations: 1, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, }, relayer.ErrNoProver, }, @@ -110,9 +111,9 @@ func Test_NewProcessor(t *testing.T) { RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoECDSAKey, @@ -124,9 +125,9 @@ func Test_NewProcessor(t *testing.T) { ECDSAKey: &ecdsa.PrivateKey{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoRPCClient, @@ -138,9 +139,9 @@ func Test_NewProcessor(t *testing.T) { ECDSAKey: &ecdsa.PrivateKey{}, RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoEthClient, @@ -154,7 +155,7 @@ func Test_NewProcessor(t *testing.T) { SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, EventRepo: &repo.EventRepository{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoBridge, @@ -167,8 +168,8 @@ func Test_NewProcessor(t *testing.T) { RPCClient: &rpc.Client{}, SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, - DestBridge: &contracts.Bridge{}, - DestHeaderSyncer: &contracts.IHeaderSync{}, + DestBridge: &bridge.Bridge{}, + DestHeaderSyncer: &iheadersync.IHeaderSync{}, Confirmations: 1, }, relayer.ErrNoEventRepository, @@ -182,7 +183,7 @@ func Test_NewProcessor(t *testing.T) { SrcETHClient: ðclient.Client{}, DestETHClient: ðclient.Client{}, EventRepo: &repo.EventRepository{}, - DestBridge: &contracts.Bridge{}, + DestBridge: &bridge.Bridge{}, Confirmations: 1, }, relayer.ErrNoTaikoL2, diff --git a/packages/relayer/message/wait_header_synced.go b/packages/relayer/message/wait_header_synced.go index 515a543169..f839bb4872 100644 --- a/packages/relayer/message/wait_header_synced.go +++ b/packages/relayer/message/wait_header_synced.go @@ -8,10 +8,10 @@ import ( "github.com/ethereum/go-ethereum/common" "github.com/pkg/errors" log "github.com/sirupsen/logrus" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) -func (p *Processor) waitHeaderSynced(ctx context.Context, event *contracts.BridgeMessageSent) error { +func (p *Processor) waitHeaderSynced(ctx context.Context, event *bridge.BridgeMessageSent) error { ticker := time.NewTicker(time.Duration(p.headerSyncIntervalSeconds) * time.Second) defer ticker.Stop() @@ -21,8 +21,8 @@ func (p *Processor) waitHeaderSynced(ctx context.Context, event *contracts.Bridg return ctx.Err() case <-ticker.C: log.Infof( - "signal: %v waiting to be processable. occured in block %v", - common.Hash(event.Signal).Hex(), + "msgHash: %v waiting to be processable. occured in block %v", + common.Hash(event.MsgHash).Hex(), event.Raw.BlockNumber, ) // get latest synced header since not every header is synced from L1 => L2, @@ -40,8 +40,8 @@ func (p *Processor) waitHeaderSynced(ctx context.Context, event *contracts.Bridg // header is caught up and processible if header.Number.Uint64() >= event.Raw.BlockNumber { log.Infof( - "signal: %v is processable. occured in block %v, latestSynced is block %v", - common.Hash(event.Signal).Hex(), + "msgHash: %v is processable. occured in block %v, latestSynced is block %v", + common.Hash(event.MsgHash).Hex(), event.Raw.BlockNumber, header.Number.Uint64(), ) @@ -50,8 +50,8 @@ func (p *Processor) waitHeaderSynced(ctx context.Context, event *contracts.Bridg } log.Infof( - "signal: %v waiting to be processable. occured in block %v, latestSynced is block %v", - common.Hash(event.Signal).Hex(), + "msgHash: %v waiting to be processable. occured in block %v, latestSynced is block %v", + common.Hash(event.MsgHash).Hex(), event.Raw.BlockNumber, header.Number.Uint64(), ) diff --git a/packages/relayer/message/wait_header_synced_test.go b/packages/relayer/message/wait_header_synced_test.go index a8bc0f43ab..46c60b7892 100644 --- a/packages/relayer/message/wait_header_synced_test.go +++ b/packages/relayer/message/wait_header_synced_test.go @@ -6,13 +6,13 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/stretchr/testify/assert" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) func Test_waitHeaderSynced(t *testing.T) { p := newTestProcessor(true) - err := p.waitHeaderSynced(context.TODO(), &contracts.BridgeMessageSent{ + err := p.waitHeaderSynced(context.TODO(), &bridge.BridgeMessageSent{ Raw: types.Log{ BlockNumber: 1, }, diff --git a/packages/relayer/mock/bridge.go b/packages/relayer/mock/bridge.go index 16c7c3357c..10b54fc13c 100644 --- a/packages/relayer/mock/bridge.go +++ b/packages/relayer/mock/bridge.go @@ -10,12 +10,12 @@ import ( "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/event" "github.com/taikoxyz/taiko-mono/packages/relayer" - "github.com/taikoxyz/taiko-mono/packages/relayer/contracts" + "github.com/taikoxyz/taiko-mono/packages/relayer/contracts/bridge" ) var ( - SuccessSignal = [32]byte{0x1} - FailSignal = [32]byte{0x2} + SuccessMsgHash = [32]byte{0x1} + FailSignal = [32]byte{0x2} ) var dummyAddress = "0x63FaC9201494f0bd17B9892B9fae4d52fe3BD377" @@ -47,17 +47,17 @@ func (s *Subscription) Unsubscribe() {} func (b *Bridge) WatchMessageSent( opts *bind.WatchOpts, - sink chan<- *contracts.BridgeMessageSent, - signal [][32]byte, + sink chan<- *bridge.BridgeMessageSent, + msgHash [][32]byte, ) (event.Subscription, error) { s := &Subscription{ errChan: make(chan error), } - go func(sink chan<- *contracts.BridgeMessageSent) { + go func(sink chan<- *bridge.BridgeMessageSent) { <-time.After(2 * time.Second) - sink <- &contracts.BridgeMessageSent{} + sink <- &bridge.BridgeMessageSent{} b.MessagesSent++ }(sink) @@ -76,12 +76,12 @@ func (b *Bridge) WatchMessageSent( func (b *Bridge) FilterMessageSent( opts *bind.FilterOpts, signal [][32]byte, -) (*contracts.BridgeMessageSentIterator, error) { - return &contracts.BridgeMessageSentIterator{}, nil +) (*bridge.BridgeMessageSentIterator, error) { + return &bridge.BridgeMessageSentIterator{}, nil } -func (b *Bridge) GetMessageStatus(opts *bind.CallOpts, signal [32]byte) (uint8, error) { - if signal == SuccessSignal { +func (b *Bridge) GetMessageStatus(opts *bind.CallOpts, msgHash [32]byte) (uint8, error) { + if msgHash == SuccessMsgHash { return uint8(relayer.EventStatusNew), nil } @@ -90,14 +90,14 @@ func (b *Bridge) GetMessageStatus(opts *bind.CallOpts, signal [32]byte) (uint8, func (b *Bridge) ProcessMessage( opts *bind.TransactOpts, - message contracts.IBridgeMessage, + message bridge.IBridgeMessage, proof []byte, ) (*types.Transaction, error) { return ProcessMessageTx, nil } func (b *Bridge) IsMessageReceived(opts *bind.CallOpts, signal [32]byte, srcChainId *big.Int, proof []byte) (bool, error) { // nolint - if signal == SuccessSignal { + if signal == SuccessMsgHash { return true, nil }