diff --git a/src/service/claim.go b/src/service/claim.go index 82b5aa3..c052536 100644 --- a/src/service/claim.go +++ b/src/service/claim.go @@ -59,12 +59,7 @@ func (r *RelayerSRV) sendClaim(worker workers.IWorker, swap *storage.Swap) (stri return "", fmt.Errorf("could not send claim tx: %s", err) } - resID := swap.ResourceID - if swap.DestinationChainID == r.laWorker.GetDestinationID() { - _, resID = utils.GetGasSwapResourceIDs(swap.ResourceID) - } else { - resID, _ = utils.GetGasSwapResourceIDs(swap.ResourceID) - } + resID := utils.GetCurrentStep(swap.ResourceID, swap.StepIndex) originDecimals, err := originWorker.GetDecimalsFromResourceID(resID) if err != nil { println("error in decimals", err.Error()) @@ -99,7 +94,7 @@ func (r *RelayerSRV) sendClaim(worker workers.IWorker, swap *storage.Swap) (stri swap.DepositNonce, swap.SenderAddr, amount, swap.ResourceID) txHash, nonce, err := worker.Vote(swap.DepositNonce, utils.StringToBytes8(swap.OriginChainID), utils.StringToBytes8(swap.DestinationChainID), - utils.StringToBytes32(swap.ResourceID), swap.ReceiverAddr, amount) + utils.StringToBytes32(swap.ResourceID), swap.StepIndex, swap.ReceiverAddr, amount) if err != nil { txSent.ErrMsg = err.Error() txSent.Status = storage.TxSentStatusNotFound diff --git a/src/service/relayer.go b/src/service/relayer.go index b5a0eda..8db122b 100644 --- a/src/service/relayer.go +++ b/src/service/relayer.go @@ -152,6 +152,7 @@ func (r *RelayerSRV) ConfirmWorkerTx(worker workers.IWorker) { InTokenAddr: txLog.InTokenAddr, DepositNonce: txLog.DepositNonce, ResourceID: txLog.ResourceID, + StepIndex: txLog.StepIndex, OutAmount: txLog.OutAmount, DestinationChainID: txLog.DestinationChainID, OriginChainID: txLog.OriginСhainID, diff --git a/src/service/storage/models.go b/src/service/storage/models.go index 3d44351..f5ab01d 100644 --- a/src/service/storage/models.go +++ b/src/service/storage/models.go @@ -32,6 +32,7 @@ type TxLog struct { DestinationChainID string `gorm:"type:TEXT"` DepositNonce uint64 `gorm:"type:BIGINT"` ResourceID string `gorm:"type:TEXT"` + StepIndex uint8 `gorm:"type:UINT"` SwapStatus SwapStatus `gorm:"type:TEXT"` ExpireHeight int64 `gorm:"type:BIGINT"` Timestamp int64 `gorm:"type:BIGINT"` @@ -59,6 +60,7 @@ type Swap struct { RelayerOutAmount string DepositNonce uint64 ResourceID string + StepIndex uint8 // ExpireHeight int64 Height int64 // Timestamp int64 diff --git a/src/service/storage/swap.go b/src/service/storage/swap.go index f84c685..85e163f 100644 --- a/src/service/storage/swap.go +++ b/src/service/storage/swap.go @@ -55,18 +55,6 @@ func (d *DataBase) GetSwapByTxHash(txHash string) (*Swap, error) { return swap, nil } -// GetSwapByTxHash ... -func (d *DataBase) GetSwapByTxHash(txHash string) (*Swap, error) { - swap := &Swap{} - if err := d.db.Where("tx_hash = ? and status in (?)", txHash, - []SwapStatus{SwapStatusDepositConfirmed, SwapStatusClaimSent, SwapStatusClaimConfirmed, SwapStatusClaimSentFailed, SwapStatusDepositFailed, SwapStatusPassedConfirmed, SwapStatusPassedSent, SwapStatusSpendSent, SwapStatusSpendConfirmed, SwapStatusRejected}). - Find(&swap).Error; err != nil { - return nil, err - } - - return swap, nil -} - // UpdateSwapStatus ... func (d *DataBase) UpdateSwapStatus(swap *Swap, status SwapStatus, rOutAmount string) { swap.Status = status diff --git a/src/service/workers/eth-compatible/abi/bridge/la/Bridge.go b/src/service/workers/eth-compatible/abi/bridge/la/Bridge.go index 9a8f735..1229272 100644 --- a/src/service/workers/eth-compatible/abi/bridge/la/Bridge.go +++ b/src/service/workers/eth-compatible/abi/bridge/la/Bridge.go @@ -28,8 +28,8 @@ var ( _ = event.NewSubscription ) -// BridgeProposal is an auto generated low-level Go binding around an user-defined struct. -type BridgeProposal struct { +// IBridgeProposal is an auto generated low-level Go binding around an user-defined struct. +type IBridgeProposal struct { ResourceID [32]byte DataHash [32]byte YesVotes []common.Address @@ -40,7 +40,7 @@ type BridgeProposal struct { // LabrMetaData contains all meta data concerning the Labr contract. var LabrMetaData = &bind.MetaData{ - ABI: "[{\"name\":\"paused\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"sub\",\"type\":\"function\",\"inputs\":[{\"name\":\"a\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"b\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"pure\"},{\"name\":\"_isInitialised\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"ownableInit\",\"type\":\"function\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"owner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"transferOwnership\",\"type\":\"function\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"verify\",\"type\":\"function\",\"inputs\":[{\"name\":\"_ethSignedMessageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_signer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"pure\"},{\"name\":\"getSigner\",\"type\":\"function\",\"inputs\":[{\"name\":\"messageHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"pure\"},{\"name\":\"createMesssageHash\",\"type\":\"function\",\"inputs\":[{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"chainId\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"pure\"},{\"name\":\"implementation\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"proxyOwner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_chainID\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"stateMutability\":\"view\"},{\"name\":\"_relayerThreshold\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"name\":\"_fee\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"name\":\"_expiry\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"view\"},{\"name\":\"_relayerHubAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_backendSrvAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_balancerAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_nativeResourceID\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"stateMutability\":\"view\"},{\"name\":\"_resourceIDToHandlerAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_depositRecords\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"stateMutability\":\"view\"},{\"name\":\"_proposals\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structBridge.Proposal\",\"components\":[{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_dataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_yesVotes\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"_noVotes\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"_status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"},{\"name\":\"_proposedBlock\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"extraLATransferred\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"setRelayerHub\",\"type\":\"function\",\"inputs\":[{\"name\":\"newRelayerHub\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBackendSrvAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newBackendSrv\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBalancerAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newBalancer\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminPauseTransfers\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminUnpauseTransfers\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"changeRelayerThreshold\",\"type\":\"function\",\"inputs\":[{\"name\":\"newThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setResource\",\"type\":\"function\",\"inputs\":[{\"name\":\"handlerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBurnable\",\"type\":\"function\",\"inputs\":[{\"name\":\"handlerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setNativeResourceID\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"getProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structBridge.Proposal\",\"components\":[{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_dataHash\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_yesVotes\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"_noVotes\",\"type\":\"address[]\",\"internalType\":\"address[]\"},{\"name\":\"_status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"},{\"name\":\"_proposedBlock\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"changeFee\",\"type\":\"function\",\"inputs\":[{\"name\":\"newFee\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminWithdraw\",\"type\":\"function\",\"inputs\":[{\"name\":\"handlerAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amountOrTokenID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"deposit\",\"type\":\"function\",\"inputs\":[{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"signature\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"payable\"},{\"name\":\"voteProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"cancelProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"executeProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"updateExternalTx\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"proposalAmount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"amountToTransfer\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminCollectFees\",\"type\":\"function\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"backendSrvCollectFees\",\"type\":\"function\",\"inputs\":[{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"addresspayable\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"approveSpending\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceIDOwner\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"resourceIDSpender\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"amountOrTokenID\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"relayerCollectReward\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"getExtraLATransferred\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"transferExtraFee\",\"type\":\"function\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"depositFunds\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"name\":\"Paused\",\"type\":\"event\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"anonymous\":false},{\"name\":\"Unpaused\",\"type\":\"event\",\"inputs\":[{\"name\":\"account\",\"type\":\"address\",\"internalType\":\"address\"}],\"anonymous\":false},{\"name\":\"OwnershipTransferred\",\"type\":\"event\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true},{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true}],\"anonymous\":false},{\"name\":\"RelayerThresholdChanged\",\"type\":\"event\",\"inputs\":[{\"name\":\"newThreshold\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"anonymous\":false},{\"name\":\"Deposit\",\"type\":\"event\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"depositor\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"anonymous\":false},{\"name\":\"ProposalEvent\",\"type\":\"event\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"name\":\"ProposalVote\",\"type\":\"event\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"anonymous\":false},{\"name\":\"RewardCollected\",\"type\":\"event\",\"inputs\":[{\"name\":\"relayer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"anonymous\":false},{\"name\":\"ExtraFeeSupplied\",\"type\":\"event\",\"inputs\":[{\"name\":\"originChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"status\",\"type\":\"uint8\",\"internalType\":\"enumBridge.ProposalStatus\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"anonymous\":false}]", + ABI: "[{\"inputs\":[],\"name\":\"_WETH\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_backendSrvAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_balancerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_bridgeDelegate\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_chainID\",\"outputs\":[{\"internalType\":\"bytes8\",\"name\":\"\",\"type\":\"bytes8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"\",\"type\":\"bytes8\"}],\"name\":\"_depositCounts\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"},{\"internalType\":\"bytes8\",\"name\":\"\",\"type\":\"bytes8\"}],\"name\":\"_depositRecords\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_dexAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_expiry\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_fee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_hasVotedOnProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_nativeResourceID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"_proposals\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"_resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"_yesVotes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_noVotes\",\"type\":\"address[]\"},{\"internalType\":\"enumIBridge.ProposalStatus\",\"name\":\"_status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"_proposedBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIBridge.Proposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_relayerHubAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_relayerThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"_resourceIDToHandlerAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_totalProposals\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"adminCollectFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminPauseTransfers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"adminUnpauseTransfers\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"handlerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amountOrTokenID\",\"type\":\"uint256\"}],\"name\":\"adminWithdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceIDOwner\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"resourceIDSpender\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amountOrTokenID\",\"type\":\"uint256\"}],\"name\":\"approveSpending\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"addresspayable\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"backendSrvCollectFees\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"}],\"name\":\"cancelProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newDEX\",\"type\":\"address\"}],\"name\":\"changeDEXAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newFee\",\"type\":\"uint256\"}],\"name\":\"changeFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newThreshold\",\"type\":\"uint256\"}],\"name\":\"changeRelayerThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newWETH\",\"type\":\"address\"}],\"name\":\"changeWETHAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"deposit\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositFunds\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"addresspayable\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"executeProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"extraLATransferred\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"getExtraLATransferred\",\"outputs\":[],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"}],\"name\":\"getProposal\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"_resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"_dataHash\",\"type\":\"bytes32\"},{\"internalType\":\"address[]\",\"name\":\"_yesVotes\",\"type\":\"address[]\"},{\"internalType\":\"address[]\",\"name\":\"_noVotes\",\"type\":\"address[]\"},{\"internalType\":\"enumIBridge.ProposalStatus\",\"name\":\"_status\",\"type\":\"uint8\"},{\"internalType\":\"uint256\",\"name\":\"_proposedBlock\",\"type\":\"uint256\"}],\"internalType\":\"structIBridge.Proposal\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"chainID_\",\"type\":\"bytes8\"},{\"internalType\":\"uint256\",\"name\":\"relayerThreshold_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"fee_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expiry_\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"initBackendSrvAddress_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"initBalancerAddress_\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"relayerCollectReward\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBackendSrv\",\"type\":\"address\"}],\"name\":\"setBackendSrvAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBalancer\",\"type\":\"address\"}],\"name\":\"setBalancerAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridgeDelegate\",\"type\":\"address\"}],\"name\":\"setBridgeDelegate\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"handlerAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"setBurnable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"}],\"name\":\"setNativeResourceID\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRelayerHub\",\"type\":\"address\"}],\"name\":\"setRelayerHub\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"handlerAddress\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"}],\"name\":\"setResource\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"transferExtraFee\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"addresspayable\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"proposalAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amountToTransfer\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"},{\"internalType\":\"enumIBridge.ProposalStatus\",\"name\":\"status\",\"type\":\"uint8\"}],\"name\":\"updateExternalTx\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"originChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"voteProposal\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // LabrABI is the input ABI used to generate the binding from. @@ -189,6 +189,37 @@ func (_Labr *LabrTransactorRaw) Transact(opts *bind.TransactOpts, method string, return _Labr.Contract.contract.Transact(opts, method, params...) } +// WETH is a free data retrieval call binding the contract method 0xe0af3616. +// +// Solidity: function _WETH() view returns(address) +func (_Labr *LabrCaller) WETH(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Labr.contract.Call(opts, &out, "_WETH") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// WETH is a free data retrieval call binding the contract method 0xe0af3616. +// +// Solidity: function _WETH() view returns(address) +func (_Labr *LabrSession) WETH() (common.Address, error) { + return _Labr.Contract.WETH(&_Labr.CallOpts) +} + +// WETH is a free data retrieval call binding the contract method 0xe0af3616. +// +// Solidity: function _WETH() view returns(address) +func (_Labr *LabrCallerSession) WETH() (common.Address, error) { + return _Labr.Contract.WETH(&_Labr.CallOpts) +} + // BackendSrvAddress is a free data retrieval call binding the contract method 0x7f5d6a5e. // // Solidity: function _backendSrvAddress() view returns(address) @@ -251,6 +282,37 @@ func (_Labr *LabrCallerSession) BalancerAddress() (common.Address, error) { return _Labr.Contract.BalancerAddress(&_Labr.CallOpts) } +// BridgeDelegate is a free data retrieval call binding the contract method 0x20f77707. +// +// Solidity: function _bridgeDelegate() view returns(address) +func (_Labr *LabrCaller) BridgeDelegate(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Labr.contract.Call(opts, &out, "_bridgeDelegate") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// BridgeDelegate is a free data retrieval call binding the contract method 0x20f77707. +// +// Solidity: function _bridgeDelegate() view returns(address) +func (_Labr *LabrSession) BridgeDelegate() (common.Address, error) { + return _Labr.Contract.BridgeDelegate(&_Labr.CallOpts) +} + +// BridgeDelegate is a free data retrieval call binding the contract method 0x20f77707. +// +// Solidity: function _bridgeDelegate() view returns(address) +func (_Labr *LabrCallerSession) BridgeDelegate() (common.Address, error) { + return _Labr.Contract.BridgeDelegate(&_Labr.CallOpts) +} + // ChainID is a free data retrieval call binding the contract method 0xbeab7131. // // Solidity: function _chainID() view returns(bytes8) @@ -282,6 +344,37 @@ func (_Labr *LabrCallerSession) ChainID() ([8]byte, error) { return _Labr.Contract.ChainID(&_Labr.CallOpts) } +// DepositCounts is a free data retrieval call binding the contract method 0x174e300b. +// +// Solidity: function _depositCounts(bytes8 ) view returns(uint64) +func (_Labr *LabrCaller) DepositCounts(opts *bind.CallOpts, arg0 [8]byte) (uint64, error) { + var out []interface{} + err := _Labr.contract.Call(opts, &out, "_depositCounts", arg0) + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// DepositCounts is a free data retrieval call binding the contract method 0x174e300b. +// +// Solidity: function _depositCounts(bytes8 ) view returns(uint64) +func (_Labr *LabrSession) DepositCounts(arg0 [8]byte) (uint64, error) { + return _Labr.Contract.DepositCounts(&_Labr.CallOpts, arg0) +} + +// DepositCounts is a free data retrieval call binding the contract method 0x174e300b. +// +// Solidity: function _depositCounts(bytes8 ) view returns(uint64) +func (_Labr *LabrCallerSession) DepositCounts(arg0 [8]byte) (uint64, error) { + return _Labr.Contract.DepositCounts(&_Labr.CallOpts, arg0) +} + // DepositRecords is a free data retrieval call binding the contract method 0xa48ace38. // // Solidity: function _depositRecords(uint64 , bytes8 ) view returns(bytes) @@ -313,6 +406,37 @@ func (_Labr *LabrCallerSession) DepositRecords(arg0 uint64, arg1 [8]byte) ([]byt return _Labr.Contract.DepositRecords(&_Labr.CallOpts, arg0, arg1) } +// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// +// Solidity: function _dexAddress() view returns(address) +func (_Labr *LabrCaller) DexAddress(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Labr.contract.Call(opts, &out, "_dexAddress") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// +// Solidity: function _dexAddress() view returns(address) +func (_Labr *LabrSession) DexAddress() (common.Address, error) { + return _Labr.Contract.DexAddress(&_Labr.CallOpts) +} + +// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// +// Solidity: function _dexAddress() view returns(address) +func (_Labr *LabrCallerSession) DexAddress() (common.Address, error) { + return _Labr.Contract.DexAddress(&_Labr.CallOpts) +} + // Expiry is a free data retrieval call binding the contract method 0xc5ec8970. // // Solidity: function _expiry() view returns(uint256) @@ -375,12 +499,12 @@ func (_Labr *LabrCallerSession) Fee() (*big.Int, error) { return _Labr.Contract.Fee(&_Labr.CallOpts) } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// HasVotedOnProposal is a free data retrieval call binding the contract method 0x86c99f0e. // -// Solidity: function _isInitialised() view returns(bool) -func (_Labr *LabrCaller) IsInitialised(opts *bind.CallOpts) (bool, error) { +// Solidity: function _hasVotedOnProposal(bytes32 , bytes32 , address ) view returns(bool) +func (_Labr *LabrCaller) HasVotedOnProposal(opts *bind.CallOpts, arg0 [32]byte, arg1 [32]byte, arg2 common.Address) (bool, error) { var out []interface{} - err := _Labr.contract.Call(opts, &out, "_isInitialised") + err := _Labr.contract.Call(opts, &out, "_hasVotedOnProposal", arg0, arg1, arg2) if err != nil { return *new(bool), err @@ -392,18 +516,18 @@ func (_Labr *LabrCaller) IsInitialised(opts *bind.CallOpts) (bool, error) { } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// HasVotedOnProposal is a free data retrieval call binding the contract method 0x86c99f0e. // -// Solidity: function _isInitialised() view returns(bool) -func (_Labr *LabrSession) IsInitialised() (bool, error) { - return _Labr.Contract.IsInitialised(&_Labr.CallOpts) +// Solidity: function _hasVotedOnProposal(bytes32 , bytes32 , address ) view returns(bool) +func (_Labr *LabrSession) HasVotedOnProposal(arg0 [32]byte, arg1 [32]byte, arg2 common.Address) (bool, error) { + return _Labr.Contract.HasVotedOnProposal(&_Labr.CallOpts, arg0, arg1, arg2) } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// HasVotedOnProposal is a free data retrieval call binding the contract method 0x86c99f0e. // -// Solidity: function _isInitialised() view returns(bool) -func (_Labr *LabrCallerSession) IsInitialised() (bool, error) { - return _Labr.Contract.IsInitialised(&_Labr.CallOpts) +// Solidity: function _hasVotedOnProposal(bytes32 , bytes32 , address ) view returns(bool) +func (_Labr *LabrCallerSession) HasVotedOnProposal(arg0 [32]byte, arg1 [32]byte, arg2 common.Address) (bool, error) { + return _Labr.Contract.HasVotedOnProposal(&_Labr.CallOpts, arg0, arg1, arg2) } // NativeResourceID is a free data retrieval call binding the contract method 0xa21b952e. @@ -440,15 +564,15 @@ func (_Labr *LabrCallerSession) NativeResourceID() ([32]byte, error) { // Proposals is a free data retrieval call binding the contract method 0x7bda741c. // // Solidity: function _proposals(bytes32 , bytes32 ) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrCaller) Proposals(opts *bind.CallOpts, arg0 [32]byte, arg1 [32]byte) (BridgeProposal, error) { +func (_Labr *LabrCaller) Proposals(opts *bind.CallOpts, arg0 [32]byte, arg1 [32]byte) (IBridgeProposal, error) { var out []interface{} err := _Labr.contract.Call(opts, &out, "_proposals", arg0, arg1) if err != nil { - return *new(BridgeProposal), err + return *new(IBridgeProposal), err } - out0 := *abi.ConvertType(out[0], new(BridgeProposal)).(*BridgeProposal) + out0 := *abi.ConvertType(out[0], new(IBridgeProposal)).(*IBridgeProposal) return out0, err @@ -457,14 +581,14 @@ func (_Labr *LabrCaller) Proposals(opts *bind.CallOpts, arg0 [32]byte, arg1 [32] // Proposals is a free data retrieval call binding the contract method 0x7bda741c. // // Solidity: function _proposals(bytes32 , bytes32 ) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrSession) Proposals(arg0 [32]byte, arg1 [32]byte) (BridgeProposal, error) { +func (_Labr *LabrSession) Proposals(arg0 [32]byte, arg1 [32]byte) (IBridgeProposal, error) { return _Labr.Contract.Proposals(&_Labr.CallOpts, arg0, arg1) } // Proposals is a free data retrieval call binding the contract method 0x7bda741c. // // Solidity: function _proposals(bytes32 , bytes32 ) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrCallerSession) Proposals(arg0 [32]byte, arg1 [32]byte) (BridgeProposal, error) { +func (_Labr *LabrCallerSession) Proposals(arg0 [32]byte, arg1 [32]byte) (IBridgeProposal, error) { return _Labr.Contract.Proposals(&_Labr.CallOpts, arg0, arg1) } @@ -561,35 +685,35 @@ func (_Labr *LabrCallerSession) ResourceIDToHandlerAddress(arg0 [32]byte) (commo return _Labr.Contract.ResourceIDToHandlerAddress(&_Labr.CallOpts, arg0) } -// CreateMesssageHash is a free data retrieval call binding the contract method 0xc79564f1. +// TotalProposals is a free data retrieval call binding the contract method 0x9d5773e0. // -// Solidity: function createMesssageHash(uint256 amount, address recipient, bytes8 chainId) pure returns(bytes32) -func (_Labr *LabrCaller) CreateMesssageHash(opts *bind.CallOpts, amount *big.Int, recipient common.Address, chainId [8]byte) ([32]byte, error) { +// Solidity: function _totalProposals() view returns(uint256) +func (_Labr *LabrCaller) TotalProposals(opts *bind.CallOpts) (*big.Int, error) { var out []interface{} - err := _Labr.contract.Call(opts, &out, "createMesssageHash", amount, recipient, chainId) + err := _Labr.contract.Call(opts, &out, "_totalProposals") 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 } -// CreateMesssageHash is a free data retrieval call binding the contract method 0xc79564f1. +// TotalProposals is a free data retrieval call binding the contract method 0x9d5773e0. // -// Solidity: function createMesssageHash(uint256 amount, address recipient, bytes8 chainId) pure returns(bytes32) -func (_Labr *LabrSession) CreateMesssageHash(amount *big.Int, recipient common.Address, chainId [8]byte) ([32]byte, error) { - return _Labr.Contract.CreateMesssageHash(&_Labr.CallOpts, amount, recipient, chainId) +// Solidity: function _totalProposals() view returns(uint256) +func (_Labr *LabrSession) TotalProposals() (*big.Int, error) { + return _Labr.Contract.TotalProposals(&_Labr.CallOpts) } -// CreateMesssageHash is a free data retrieval call binding the contract method 0xc79564f1. +// TotalProposals is a free data retrieval call binding the contract method 0x9d5773e0. // -// Solidity: function createMesssageHash(uint256 amount, address recipient, bytes8 chainId) pure returns(bytes32) -func (_Labr *LabrCallerSession) CreateMesssageHash(amount *big.Int, recipient common.Address, chainId [8]byte) ([32]byte, error) { - return _Labr.Contract.CreateMesssageHash(&_Labr.CallOpts, amount, recipient, chainId) +// Solidity: function _totalProposals() view returns(uint256) +func (_Labr *LabrCallerSession) TotalProposals() (*big.Int, error) { + return _Labr.Contract.TotalProposals(&_Labr.CallOpts) } // ExtraLATransferred is a free data retrieval call binding the contract method 0x51fc8c58. @@ -625,47 +749,45 @@ func (_Labr *LabrCallerSession) ExtraLATransferred(arg0 [32]byte, arg1 [32]byte) // GetExtraLATransferred is a free data retrieval call binding the contract method 0xd4ae814c. // -// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns(bool) -func (_Labr *LabrCaller) GetExtraLATransferred(opts *bind.CallOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (bool, error) { +// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns() +func (_Labr *LabrCaller) GetExtraLATransferred(opts *bind.CallOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) error { var out []interface{} err := _Labr.contract.Call(opts, &out, "getExtraLATransferred", originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) if err != nil { - return *new(bool), err + return err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err + return err } // GetExtraLATransferred is a free data retrieval call binding the contract method 0xd4ae814c. // -// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns(bool) -func (_Labr *LabrSession) GetExtraLATransferred(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (bool, error) { +// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns() +func (_Labr *LabrSession) GetExtraLATransferred(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) error { return _Labr.Contract.GetExtraLATransferred(&_Labr.CallOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) } // GetExtraLATransferred is a free data retrieval call binding the contract method 0xd4ae814c. // -// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns(bool) -func (_Labr *LabrCallerSession) GetExtraLATransferred(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (bool, error) { +// Solidity: function getExtraLATransferred(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) view returns() +func (_Labr *LabrCallerSession) GetExtraLATransferred(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) error { return _Labr.Contract.GetExtraLATransferred(&_Labr.CallOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) } // GetProposal is a free data retrieval call binding the contract method 0xa241c0dd. // // Solidity: function getProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, address recipientAddress, uint256 amount, bytes32 resourceID) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrCaller) GetProposal(opts *bind.CallOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (BridgeProposal, error) { +func (_Labr *LabrCaller) GetProposal(opts *bind.CallOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (IBridgeProposal, error) { var out []interface{} err := _Labr.contract.Call(opts, &out, "getProposal", originChainID, destinationChainID, depositNonce, recipientAddress, amount, resourceID) if err != nil { - return *new(BridgeProposal), err + return *new(IBridgeProposal), err } - out0 := *abi.ConvertType(out[0], new(BridgeProposal)).(*BridgeProposal) + out0 := *abi.ConvertType(out[0], new(IBridgeProposal)).(*IBridgeProposal) return out0, err @@ -674,234 +796,17 @@ func (_Labr *LabrCaller) GetProposal(opts *bind.CallOpts, originChainID [8]byte, // GetProposal is a free data retrieval call binding the contract method 0xa241c0dd. // // Solidity: function getProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, address recipientAddress, uint256 amount, bytes32 resourceID) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrSession) GetProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (BridgeProposal, error) { +func (_Labr *LabrSession) GetProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (IBridgeProposal, error) { return _Labr.Contract.GetProposal(&_Labr.CallOpts, originChainID, destinationChainID, depositNonce, recipientAddress, amount, resourceID) } // GetProposal is a free data retrieval call binding the contract method 0xa241c0dd. // // Solidity: function getProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, address recipientAddress, uint256 amount, bytes32 resourceID) view returns((bytes32,bytes32,address[],address[],uint8,uint256)) -func (_Labr *LabrCallerSession) GetProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (BridgeProposal, error) { +func (_Labr *LabrCallerSession) GetProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, recipientAddress common.Address, amount *big.Int, resourceID [32]byte) (IBridgeProposal, error) { return _Labr.Contract.GetProposal(&_Labr.CallOpts, originChainID, destinationChainID, depositNonce, recipientAddress, amount, resourceID) } -// GetSigner is a free data retrieval call binding the contract method 0xf7b2ec0d. -// -// Solidity: function getSigner(bytes32 messageHash, bytes signature) pure returns(address) -func (_Labr *LabrCaller) GetSigner(opts *bind.CallOpts, messageHash [32]byte, signature []byte) (common.Address, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "getSigner", messageHash, signature) - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// GetSigner is a free data retrieval call binding the contract method 0xf7b2ec0d. -// -// Solidity: function getSigner(bytes32 messageHash, bytes signature) pure returns(address) -func (_Labr *LabrSession) GetSigner(messageHash [32]byte, signature []byte) (common.Address, error) { - return _Labr.Contract.GetSigner(&_Labr.CallOpts, messageHash, signature) -} - -// GetSigner is a free data retrieval call binding the contract method 0xf7b2ec0d. -// -// Solidity: function getSigner(bytes32 messageHash, bytes signature) pure returns(address) -func (_Labr *LabrCallerSession) GetSigner(messageHash [32]byte, signature []byte) (common.Address, error) { - return _Labr.Contract.GetSigner(&_Labr.CallOpts, messageHash, signature) -} - -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. -// -// Solidity: function implementation() view returns(address) -func (_Labr *LabrCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "implementation") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. -// -// Solidity: function implementation() view returns(address) -func (_Labr *LabrSession) Implementation() (common.Address, error) { - return _Labr.Contract.Implementation(&_Labr.CallOpts) -} - -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. -// -// Solidity: function implementation() view returns(address) -func (_Labr *LabrCallerSession) Implementation() (common.Address, error) { - return _Labr.Contract.Implementation(&_Labr.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Labr *LabrCaller) Owner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "owner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Labr *LabrSession) Owner() (common.Address, error) { - return _Labr.Contract.Owner(&_Labr.CallOpts) -} - -// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. -// -// Solidity: function owner() view returns(address) -func (_Labr *LabrCallerSession) Owner() (common.Address, error) { - return _Labr.Contract.Owner(&_Labr.CallOpts) -} - -// Paused is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(bool) -func (_Labr *LabrCaller) Paused(opts *bind.CallOpts) (bool, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "paused") - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Paused is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(bool) -func (_Labr *LabrSession) Paused() (bool, error) { - return _Labr.Contract.Paused(&_Labr.CallOpts) -} - -// Paused is a free data retrieval call binding the contract method 0x5c975abb. -// -// Solidity: function paused() view returns(bool) -func (_Labr *LabrCallerSession) Paused() (bool, error) { - return _Labr.Contract.Paused(&_Labr.CallOpts) -} - -// ProxyOwner is a free data retrieval call binding the contract method 0x025313a2. -// -// Solidity: function proxyOwner() view returns(address) -func (_Labr *LabrCaller) ProxyOwner(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "proxyOwner") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// ProxyOwner is a free data retrieval call binding the contract method 0x025313a2. -// -// Solidity: function proxyOwner() view returns(address) -func (_Labr *LabrSession) ProxyOwner() (common.Address, error) { - return _Labr.Contract.ProxyOwner(&_Labr.CallOpts) -} - -// ProxyOwner is a free data retrieval call binding the contract method 0x025313a2. -// -// Solidity: function proxyOwner() view returns(address) -func (_Labr *LabrCallerSession) ProxyOwner() (common.Address, error) { - return _Labr.Contract.ProxyOwner(&_Labr.CallOpts) -} - -// Sub is a free data retrieval call binding the contract method 0xb67d77c5. -// -// Solidity: function sub(uint256 a, uint256 b) pure returns(uint256) -func (_Labr *LabrCaller) Sub(opts *bind.CallOpts, a *big.Int, b *big.Int) (*big.Int, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "sub", a, b) - - if err != nil { - return *new(*big.Int), err - } - - out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) - - return out0, err - -} - -// Sub is a free data retrieval call binding the contract method 0xb67d77c5. -// -// Solidity: function sub(uint256 a, uint256 b) pure returns(uint256) -func (_Labr *LabrSession) Sub(a *big.Int, b *big.Int) (*big.Int, error) { - return _Labr.Contract.Sub(&_Labr.CallOpts, a, b) -} - -// Sub is a free data retrieval call binding the contract method 0xb67d77c5. -// -// Solidity: function sub(uint256 a, uint256 b) pure returns(uint256) -func (_Labr *LabrCallerSession) Sub(a *big.Int, b *big.Int) (*big.Int, error) { - return _Labr.Contract.Sub(&_Labr.CallOpts, a, b) -} - -// Verify is a free data retrieval call binding the contract method 0xf5cf2ce1. -// -// Solidity: function verify(bytes32 _ethSignedMessageHash, address _signer, bytes _signature) pure returns(bool) -func (_Labr *LabrCaller) Verify(opts *bind.CallOpts, _ethSignedMessageHash [32]byte, _signer common.Address, _signature []byte) (bool, error) { - var out []interface{} - err := _Labr.contract.Call(opts, &out, "verify", _ethSignedMessageHash, _signer, _signature) - - if err != nil { - return *new(bool), err - } - - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) - - return out0, err - -} - -// Verify is a free data retrieval call binding the contract method 0xf5cf2ce1. -// -// Solidity: function verify(bytes32 _ethSignedMessageHash, address _signer, bytes _signature) pure returns(bool) -func (_Labr *LabrSession) Verify(_ethSignedMessageHash [32]byte, _signer common.Address, _signature []byte) (bool, error) { - return _Labr.Contract.Verify(&_Labr.CallOpts, _ethSignedMessageHash, _signer, _signature) -} - -// Verify is a free data retrieval call binding the contract method 0xf5cf2ce1. -// -// Solidity: function verify(bytes32 _ethSignedMessageHash, address _signer, bytes _signature) pure returns(bool) -func (_Labr *LabrCallerSession) Verify(_ethSignedMessageHash [32]byte, _signer common.Address, _signature []byte) (bool, error) { - return _Labr.Contract.Verify(&_Labr.CallOpts, _ethSignedMessageHash, _signer, _signature) -} - // AdminCollectFees is a paid mutator transaction binding the contract method 0x7a7eed77. // // Solidity: function adminCollectFees(address recipient, uint256 amount) returns() @@ -1049,6 +954,27 @@ func (_Labr *LabrTransactorSession) CancelProposal(originChainID [8]byte, destin return _Labr.Contract.CancelProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, recipientAddress, amount, resourceID) } +// ChangeDEXAddress is a paid mutator transaction binding the contract method 0x415d86d0. +// +// Solidity: function changeDEXAddress(address newDEX) returns() +func (_Labr *LabrTransactor) ChangeDEXAddress(opts *bind.TransactOpts, newDEX common.Address) (*types.Transaction, error) { + return _Labr.contract.Transact(opts, "changeDEXAddress", newDEX) +} + +// ChangeDEXAddress is a paid mutator transaction binding the contract method 0x415d86d0. +// +// Solidity: function changeDEXAddress(address newDEX) returns() +func (_Labr *LabrSession) ChangeDEXAddress(newDEX common.Address) (*types.Transaction, error) { + return _Labr.Contract.ChangeDEXAddress(&_Labr.TransactOpts, newDEX) +} + +// ChangeDEXAddress is a paid mutator transaction binding the contract method 0x415d86d0. +// +// Solidity: function changeDEXAddress(address newDEX) returns() +func (_Labr *LabrTransactorSession) ChangeDEXAddress(newDEX common.Address) (*types.Transaction, error) { + return _Labr.Contract.ChangeDEXAddress(&_Labr.TransactOpts, newDEX) +} + // ChangeFee is a paid mutator transaction binding the contract method 0x6a1db1bf. // // Solidity: function changeFee(uint256 newFee) returns() @@ -1091,6 +1017,27 @@ func (_Labr *LabrTransactorSession) ChangeRelayerThreshold(newThreshold *big.Int return _Labr.Contract.ChangeRelayerThreshold(&_Labr.TransactOpts, newThreshold) } +// ChangeWETHAddress is a paid mutator transaction binding the contract method 0x5fca9717. +// +// Solidity: function changeWETHAddress(address newWETH) returns() +func (_Labr *LabrTransactor) ChangeWETHAddress(opts *bind.TransactOpts, newWETH common.Address) (*types.Transaction, error) { + return _Labr.contract.Transact(opts, "changeWETHAddress", newWETH) +} + +// ChangeWETHAddress is a paid mutator transaction binding the contract method 0x5fca9717. +// +// Solidity: function changeWETHAddress(address newWETH) returns() +func (_Labr *LabrSession) ChangeWETHAddress(newWETH common.Address) (*types.Transaction, error) { + return _Labr.Contract.ChangeWETHAddress(&_Labr.TransactOpts, newWETH) +} + +// ChangeWETHAddress is a paid mutator transaction binding the contract method 0x5fca9717. +// +// Solidity: function changeWETHAddress(address newWETH) returns() +func (_Labr *LabrTransactorSession) ChangeWETHAddress(newWETH common.Address) (*types.Transaction, error) { + return _Labr.Contract.ChangeWETHAddress(&_Labr.TransactOpts, newWETH) +} + // Deposit is a paid mutator transaction binding the contract method 0x98ce7a18. // // Solidity: function deposit(bytes8 destinationChainID, bytes32 resourceID, uint256 amount, address recipientAddress, bytes signature, bytes params) payable returns() @@ -1154,25 +1101,25 @@ func (_Labr *LabrTransactorSession) ExecuteProposal(originChainID [8]byte, desti return _Labr.Contract.ExecuteProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount, params) } -// OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. +// Initialize is a paid mutator transaction binding the contract method 0x37d8d3a8. // -// Solidity: function ownableInit(address owner_) returns() -func (_Labr *LabrTransactor) OwnableInit(opts *bind.TransactOpts, owner_ common.Address) (*types.Transaction, error) { - return _Labr.contract.Transact(opts, "ownableInit", owner_) +// Solidity: function initialize(bytes8 chainID_, uint256 relayerThreshold_, uint256 fee_, uint256 expiry_, address ownerAddress, address initBackendSrvAddress_, address initBalancerAddress_) returns() +func (_Labr *LabrTransactor) Initialize(opts *bind.TransactOpts, chainID_ [8]byte, relayerThreshold_ *big.Int, fee_ *big.Int, expiry_ *big.Int, ownerAddress common.Address, initBackendSrvAddress_ common.Address, initBalancerAddress_ common.Address) (*types.Transaction, error) { + return _Labr.contract.Transact(opts, "initialize", chainID_, relayerThreshold_, fee_, expiry_, ownerAddress, initBackendSrvAddress_, initBalancerAddress_) } -// OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. +// Initialize is a paid mutator transaction binding the contract method 0x37d8d3a8. // -// Solidity: function ownableInit(address owner_) returns() -func (_Labr *LabrSession) OwnableInit(owner_ common.Address) (*types.Transaction, error) { - return _Labr.Contract.OwnableInit(&_Labr.TransactOpts, owner_) +// Solidity: function initialize(bytes8 chainID_, uint256 relayerThreshold_, uint256 fee_, uint256 expiry_, address ownerAddress, address initBackendSrvAddress_, address initBalancerAddress_) returns() +func (_Labr *LabrSession) Initialize(chainID_ [8]byte, relayerThreshold_ *big.Int, fee_ *big.Int, expiry_ *big.Int, ownerAddress common.Address, initBackendSrvAddress_ common.Address, initBalancerAddress_ common.Address) (*types.Transaction, error) { + return _Labr.Contract.Initialize(&_Labr.TransactOpts, chainID_, relayerThreshold_, fee_, expiry_, ownerAddress, initBackendSrvAddress_, initBalancerAddress_) } -// OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. +// Initialize is a paid mutator transaction binding the contract method 0x37d8d3a8. // -// Solidity: function ownableInit(address owner_) returns() -func (_Labr *LabrTransactorSession) OwnableInit(owner_ common.Address) (*types.Transaction, error) { - return _Labr.Contract.OwnableInit(&_Labr.TransactOpts, owner_) +// Solidity: function initialize(bytes8 chainID_, uint256 relayerThreshold_, uint256 fee_, uint256 expiry_, address ownerAddress, address initBackendSrvAddress_, address initBalancerAddress_) returns() +func (_Labr *LabrTransactorSession) Initialize(chainID_ [8]byte, relayerThreshold_ *big.Int, fee_ *big.Int, expiry_ *big.Int, ownerAddress common.Address, initBackendSrvAddress_ common.Address, initBalancerAddress_ common.Address) (*types.Transaction, error) { + return _Labr.Contract.Initialize(&_Labr.TransactOpts, chainID_, relayerThreshold_, fee_, expiry_, ownerAddress, initBackendSrvAddress_, initBalancerAddress_) } // RelayerCollectReward is a paid mutator transaction binding the contract method 0xf408da91. @@ -1238,6 +1185,27 @@ func (_Labr *LabrTransactorSession) SetBalancerAddress(newBalancer common.Addres return _Labr.Contract.SetBalancerAddress(&_Labr.TransactOpts, newBalancer) } +// SetBridgeDelegate is a paid mutator transaction binding the contract method 0xe0325208. +// +// Solidity: function setBridgeDelegate(address newBridgeDelegate) returns() +func (_Labr *LabrTransactor) SetBridgeDelegate(opts *bind.TransactOpts, newBridgeDelegate common.Address) (*types.Transaction, error) { + return _Labr.contract.Transact(opts, "setBridgeDelegate", newBridgeDelegate) +} + +// SetBridgeDelegate is a paid mutator transaction binding the contract method 0xe0325208. +// +// Solidity: function setBridgeDelegate(address newBridgeDelegate) returns() +func (_Labr *LabrSession) SetBridgeDelegate(newBridgeDelegate common.Address) (*types.Transaction, error) { + return _Labr.Contract.SetBridgeDelegate(&_Labr.TransactOpts, newBridgeDelegate) +} + +// SetBridgeDelegate is a paid mutator transaction binding the contract method 0xe0325208. +// +// Solidity: function setBridgeDelegate(address newBridgeDelegate) returns() +func (_Labr *LabrTransactorSession) SetBridgeDelegate(newBridgeDelegate common.Address) (*types.Transaction, error) { + return _Labr.Contract.SetBridgeDelegate(&_Labr.TransactOpts, newBridgeDelegate) +} + // SetBurnable is a paid mutator transaction binding the contract method 0xdf0fc133. // // Solidity: function setBurnable(address handlerAddress, address tokenAddress) returns() @@ -1343,27 +1311,6 @@ func (_Labr *LabrTransactorSession) TransferExtraFee(originChainID [8]byte, dest return _Labr.Contract.TransferExtraFee(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipient, amount, params) } -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Labr *LabrTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { - return _Labr.contract.Transact(opts, "transferOwnership", newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Labr *LabrSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Labr.Contract.TransferOwnership(&_Labr.TransactOpts, newOwner) -} - -// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. -// -// Solidity: function transferOwnership(address newOwner) returns() -func (_Labr *LabrTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { - return _Labr.Contract.TransferOwnership(&_Labr.TransactOpts, newOwner) -} - // UpdateExternalTx is a paid mutator transaction binding the contract method 0x00ecbc2c. // // Solidity: function updateExternalTx(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 proposalAmount, uint256 amountToTransfer, bytes params, uint8 status) returns() @@ -1385,1273 +1332,23 @@ func (_Labr *LabrTransactorSession) UpdateExternalTx(originChainID [8]byte, dest return _Labr.Contract.UpdateExternalTx(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, proposalAmount, amountToTransfer, params, status) } -// VoteProposal is a paid mutator transaction binding the contract method 0x776860da. +// VoteProposal is a paid mutator transaction binding the contract method 0x369ab5ac. // -// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) returns() -func (_Labr *LabrTransactor) VoteProposal(opts *bind.TransactOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _Labr.contract.Transact(opts, "voteProposal", originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) +// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +func (_Labr *LabrTransactor) VoteProposal(opts *bind.TransactOpts, originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _Labr.contract.Transact(opts, "voteProposal", originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount, params) } -// VoteProposal is a paid mutator transaction binding the contract method 0x776860da. +// VoteProposal is a paid mutator transaction binding the contract method 0x369ab5ac. // -// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) returns() -func (_Labr *LabrSession) VoteProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _Labr.Contract.VoteProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) +// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +func (_Labr *LabrSession) VoteProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _Labr.Contract.VoteProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount, params) } -// VoteProposal is a paid mutator transaction binding the contract method 0x776860da. +// VoteProposal is a paid mutator transaction binding the contract method 0x369ab5ac. // -// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount) returns() -func (_Labr *LabrTransactorSession) VoteProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _Labr.Contract.VoteProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount) -} - -// LabrDepositIterator is returned from FilterDeposit and is used to iterate over the raw logs and unpacked data for Deposit events raised by the Labr contract. -type LabrDepositIterator struct { - Event *LabrDeposit // 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 *LabrDepositIterator) 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(LabrDeposit) - 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(LabrDeposit) - 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 *LabrDepositIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrDepositIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrDeposit represents a Deposit event raised by the Labr contract. -type LabrDeposit struct { - OriginChainID [8]byte - DestinationChainID [8]byte - ResourceID [32]byte - DepositNonce uint64 - Depositor common.Address - RecipientAddress common.Address - TokenAddress common.Address - Amount *big.Int - Params []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterDeposit is a free log retrieval operation binding the contract event 0x3cdf0bc4e2723a2132944314ba37022e8f01ee627cbbc3c834065f80f8b2b04f. -// -// Solidity: event Deposit(bytes8 originChainID, bytes8 destinationChainID, bytes32 resourceID, uint64 depositNonce, address depositor, address recipientAddress, address tokenAddress, uint256 amount, bytes params) -func (_Labr *LabrFilterer) FilterDeposit(opts *bind.FilterOpts) (*LabrDepositIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "Deposit") - if err != nil { - return nil, err - } - return &LabrDepositIterator{contract: _Labr.contract, event: "Deposit", logs: logs, sub: sub}, nil -} - -// WatchDeposit is a free log subscription operation binding the contract event 0x3cdf0bc4e2723a2132944314ba37022e8f01ee627cbbc3c834065f80f8b2b04f. -// -// Solidity: event Deposit(bytes8 originChainID, bytes8 destinationChainID, bytes32 resourceID, uint64 depositNonce, address depositor, address recipientAddress, address tokenAddress, uint256 amount, bytes params) -func (_Labr *LabrFilterer) WatchDeposit(opts *bind.WatchOpts, sink chan<- *LabrDeposit) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "Deposit") - 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(LabrDeposit) - if err := _Labr.contract.UnpackLog(event, "Deposit", 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 -} - -// ParseDeposit is a log parse operation binding the contract event 0x3cdf0bc4e2723a2132944314ba37022e8f01ee627cbbc3c834065f80f8b2b04f. -// -// Solidity: event Deposit(bytes8 originChainID, bytes8 destinationChainID, bytes32 resourceID, uint64 depositNonce, address depositor, address recipientAddress, address tokenAddress, uint256 amount, bytes params) -func (_Labr *LabrFilterer) ParseDeposit(log types.Log) (*LabrDeposit, error) { - event := new(LabrDeposit) - if err := _Labr.contract.UnpackLog(event, "Deposit", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrExtraFeeSuppliedIterator is returned from FilterExtraFeeSupplied and is used to iterate over the raw logs and unpacked data for ExtraFeeSupplied events raised by the Labr contract. -type LabrExtraFeeSuppliedIterator struct { - Event *LabrExtraFeeSupplied // 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 *LabrExtraFeeSuppliedIterator) 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(LabrExtraFeeSupplied) - 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(LabrExtraFeeSupplied) - 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 *LabrExtraFeeSuppliedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrExtraFeeSuppliedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrExtraFeeSupplied represents a ExtraFeeSupplied event raised by the Labr contract. -type LabrExtraFeeSupplied struct { - OriginChainID [8]byte - DestinationChainID [8]byte - DepositNonce uint64 - ResourceID [32]byte - RecipientAddress common.Address - Amount *big.Int - Status uint8 - Params []byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterExtraFeeSupplied is a free log retrieval operation binding the contract event 0xa111a4bf39fd61f7abcd239236bed67639dd6c74bf937b213b862b51397d65db. -// -// Solidity: event ExtraFeeSupplied(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, uint8 status, bytes params) -func (_Labr *LabrFilterer) FilterExtraFeeSupplied(opts *bind.FilterOpts) (*LabrExtraFeeSuppliedIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "ExtraFeeSupplied") - if err != nil { - return nil, err - } - return &LabrExtraFeeSuppliedIterator{contract: _Labr.contract, event: "ExtraFeeSupplied", logs: logs, sub: sub}, nil -} - -// WatchExtraFeeSupplied is a free log subscription operation binding the contract event 0xa111a4bf39fd61f7abcd239236bed67639dd6c74bf937b213b862b51397d65db. -// -// Solidity: event ExtraFeeSupplied(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, uint8 status, bytes params) -func (_Labr *LabrFilterer) WatchExtraFeeSupplied(opts *bind.WatchOpts, sink chan<- *LabrExtraFeeSupplied) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "ExtraFeeSupplied") - 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(LabrExtraFeeSupplied) - if err := _Labr.contract.UnpackLog(event, "ExtraFeeSupplied", 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 -} - -// ParseExtraFeeSupplied is a log parse operation binding the contract event 0xa111a4bf39fd61f7abcd239236bed67639dd6c74bf937b213b862b51397d65db. -// -// Solidity: event ExtraFeeSupplied(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, uint8 status, bytes params) -func (_Labr *LabrFilterer) ParseExtraFeeSupplied(log types.Log) (*LabrExtraFeeSupplied, error) { - event := new(LabrExtraFeeSupplied) - if err := _Labr.contract.UnpackLog(event, "ExtraFeeSupplied", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the Labr contract. -type LabrOwnershipTransferredIterator struct { - Event *LabrOwnershipTransferred // 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 *LabrOwnershipTransferredIterator) 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(LabrOwnershipTransferred) - 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(LabrOwnershipTransferred) - 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 *LabrOwnershipTransferredIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrOwnershipTransferredIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrOwnershipTransferred represents a OwnershipTransferred event raised by the Labr contract. -type LabrOwnershipTransferred struct { - PreviousOwner common.Address - NewOwner common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterOwnershipTransferred is a free log retrieval operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Labr *LabrFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*LabrOwnershipTransferredIterator, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Labr.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - if err != nil { - return nil, err - } - return &LabrOwnershipTransferredIterator{contract: _Labr.contract, event: "OwnershipTransferred", logs: logs, sub: sub}, nil -} - -// WatchOwnershipTransferred is a free log subscription operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Labr *LabrFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *LabrOwnershipTransferred, previousOwner []common.Address, newOwner []common.Address) (event.Subscription, error) { - - var previousOwnerRule []interface{} - for _, previousOwnerItem := range previousOwner { - previousOwnerRule = append(previousOwnerRule, previousOwnerItem) - } - var newOwnerRule []interface{} - for _, newOwnerItem := range newOwner { - newOwnerRule = append(newOwnerRule, newOwnerItem) - } - - logs, sub, err := _Labr.contract.WatchLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) - 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(LabrOwnershipTransferred) - if err := _Labr.contract.UnpackLog(event, "OwnershipTransferred", 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 -} - -// ParseOwnershipTransferred is a log parse operation binding the contract event 0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0. -// -// Solidity: event OwnershipTransferred(address indexed previousOwner, address indexed newOwner) -func (_Labr *LabrFilterer) ParseOwnershipTransferred(log types.Log) (*LabrOwnershipTransferred, error) { - event := new(LabrOwnershipTransferred) - if err := _Labr.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrPausedIterator is returned from FilterPaused and is used to iterate over the raw logs and unpacked data for Paused events raised by the Labr contract. -type LabrPausedIterator struct { - Event *LabrPaused // 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 *LabrPausedIterator) 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(LabrPaused) - 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(LabrPaused) - 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 *LabrPausedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrPausedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrPaused represents a Paused event raised by the Labr contract. -type LabrPaused struct { - Account common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterPaused is a free log retrieval operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. -// -// Solidity: event Paused(address account) -func (_Labr *LabrFilterer) FilterPaused(opts *bind.FilterOpts) (*LabrPausedIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "Paused") - if err != nil { - return nil, err - } - return &LabrPausedIterator{contract: _Labr.contract, event: "Paused", logs: logs, sub: sub}, nil -} - -// WatchPaused is a free log subscription operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. -// -// Solidity: event Paused(address account) -func (_Labr *LabrFilterer) WatchPaused(opts *bind.WatchOpts, sink chan<- *LabrPaused) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "Paused") - 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(LabrPaused) - if err := _Labr.contract.UnpackLog(event, "Paused", 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 -} - -// ParsePaused is a log parse operation binding the contract event 0x62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a258. -// -// Solidity: event Paused(address account) -func (_Labr *LabrFilterer) ParsePaused(log types.Log) (*LabrPaused, error) { - event := new(LabrPaused) - if err := _Labr.contract.UnpackLog(event, "Paused", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrProposalEventIterator is returned from FilterProposalEvent and is used to iterate over the raw logs and unpacked data for ProposalEvent events raised by the Labr contract. -type LabrProposalEventIterator struct { - Event *LabrProposalEvent // 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 *LabrProposalEventIterator) 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(LabrProposalEvent) - 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(LabrProposalEvent) - 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 *LabrProposalEventIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrProposalEventIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrProposalEvent represents a ProposalEvent event raised by the Labr contract. -type LabrProposalEvent struct { - OriginChainID [8]byte - DestinationChainID [8]byte - RecipientAddress common.Address - Amount *big.Int - DepositNonce uint64 - Status uint8 - ResourceID [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterProposalEvent is a free log retrieval operation binding the contract event 0x98515ff66d46eef043e6e17beb65b19f71802dc829ff974ca92d66d61019286d. -// -// Solidity: event ProposalEvent(bytes8 originChainID, bytes8 destinationChainID, address recipientAddress, uint256 amount, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) FilterProposalEvent(opts *bind.FilterOpts) (*LabrProposalEventIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "ProposalEvent") - if err != nil { - return nil, err - } - return &LabrProposalEventIterator{contract: _Labr.contract, event: "ProposalEvent", logs: logs, sub: sub}, nil -} - -// WatchProposalEvent is a free log subscription operation binding the contract event 0x98515ff66d46eef043e6e17beb65b19f71802dc829ff974ca92d66d61019286d. -// -// Solidity: event ProposalEvent(bytes8 originChainID, bytes8 destinationChainID, address recipientAddress, uint256 amount, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) WatchProposalEvent(opts *bind.WatchOpts, sink chan<- *LabrProposalEvent) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "ProposalEvent") - 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(LabrProposalEvent) - if err := _Labr.contract.UnpackLog(event, "ProposalEvent", 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 -} - -// ParseProposalEvent is a log parse operation binding the contract event 0x98515ff66d46eef043e6e17beb65b19f71802dc829ff974ca92d66d61019286d. -// -// Solidity: event ProposalEvent(bytes8 originChainID, bytes8 destinationChainID, address recipientAddress, uint256 amount, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) ParseProposalEvent(log types.Log) (*LabrProposalEvent, error) { - event := new(LabrProposalEvent) - if err := _Labr.contract.UnpackLog(event, "ProposalEvent", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrProposalVoteIterator is returned from FilterProposalVote and is used to iterate over the raw logs and unpacked data for ProposalVote events raised by the Labr contract. -type LabrProposalVoteIterator struct { - Event *LabrProposalVote // 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 *LabrProposalVoteIterator) 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(LabrProposalVote) - 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(LabrProposalVote) - 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 *LabrProposalVoteIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrProposalVoteIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrProposalVote represents a ProposalVote event raised by the Labr contract. -type LabrProposalVote struct { - OriginChainID [8]byte - DepositNonce uint64 - Status uint8 - ResourceID [32]byte - Raw types.Log // Blockchain specific contextual infos -} - -// FilterProposalVote is a free log retrieval operation binding the contract event 0x85f41114efc645854a10eef33ef4dec54341cb3ec3ab32386c92c881f3b1b505. -// -// Solidity: event ProposalVote(bytes8 originChainID, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) FilterProposalVote(opts *bind.FilterOpts) (*LabrProposalVoteIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "ProposalVote") - if err != nil { - return nil, err - } - return &LabrProposalVoteIterator{contract: _Labr.contract, event: "ProposalVote", logs: logs, sub: sub}, nil -} - -// WatchProposalVote is a free log subscription operation binding the contract event 0x85f41114efc645854a10eef33ef4dec54341cb3ec3ab32386c92c881f3b1b505. -// -// Solidity: event ProposalVote(bytes8 originChainID, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) WatchProposalVote(opts *bind.WatchOpts, sink chan<- *LabrProposalVote) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "ProposalVote") - 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(LabrProposalVote) - if err := _Labr.contract.UnpackLog(event, "ProposalVote", 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 -} - -// ParseProposalVote is a log parse operation binding the contract event 0x85f41114efc645854a10eef33ef4dec54341cb3ec3ab32386c92c881f3b1b505. -// -// Solidity: event ProposalVote(bytes8 originChainID, uint64 depositNonce, uint8 status, bytes32 resourceID) -func (_Labr *LabrFilterer) ParseProposalVote(log types.Log) (*LabrProposalVote, error) { - event := new(LabrProposalVote) - if err := _Labr.contract.UnpackLog(event, "ProposalVote", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrRelayerThresholdChangedIterator is returned from FilterRelayerThresholdChanged and is used to iterate over the raw logs and unpacked data for RelayerThresholdChanged events raised by the Labr contract. -type LabrRelayerThresholdChangedIterator struct { - Event *LabrRelayerThresholdChanged // 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 *LabrRelayerThresholdChangedIterator) 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(LabrRelayerThresholdChanged) - 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(LabrRelayerThresholdChanged) - 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 *LabrRelayerThresholdChangedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrRelayerThresholdChangedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrRelayerThresholdChanged represents a RelayerThresholdChanged event raised by the Labr contract. -type LabrRelayerThresholdChanged struct { - NewThreshold *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRelayerThresholdChanged is a free log retrieval operation binding the contract event 0xa20d6b84cd798a24038be305eff8a45ca82ef54a2aa2082005d8e14c0a4746c8. -// -// Solidity: event RelayerThresholdChanged(uint256 newThreshold) -func (_Labr *LabrFilterer) FilterRelayerThresholdChanged(opts *bind.FilterOpts) (*LabrRelayerThresholdChangedIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "RelayerThresholdChanged") - if err != nil { - return nil, err - } - return &LabrRelayerThresholdChangedIterator{contract: _Labr.contract, event: "RelayerThresholdChanged", logs: logs, sub: sub}, nil -} - -// WatchRelayerThresholdChanged is a free log subscription operation binding the contract event 0xa20d6b84cd798a24038be305eff8a45ca82ef54a2aa2082005d8e14c0a4746c8. -// -// Solidity: event RelayerThresholdChanged(uint256 newThreshold) -func (_Labr *LabrFilterer) WatchRelayerThresholdChanged(opts *bind.WatchOpts, sink chan<- *LabrRelayerThresholdChanged) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "RelayerThresholdChanged") - 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(LabrRelayerThresholdChanged) - if err := _Labr.contract.UnpackLog(event, "RelayerThresholdChanged", 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 -} - -// ParseRelayerThresholdChanged is a log parse operation binding the contract event 0xa20d6b84cd798a24038be305eff8a45ca82ef54a2aa2082005d8e14c0a4746c8. -// -// Solidity: event RelayerThresholdChanged(uint256 newThreshold) -func (_Labr *LabrFilterer) ParseRelayerThresholdChanged(log types.Log) (*LabrRelayerThresholdChanged, error) { - event := new(LabrRelayerThresholdChanged) - if err := _Labr.contract.UnpackLog(event, "RelayerThresholdChanged", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrRewardCollectedIterator is returned from FilterRewardCollected and is used to iterate over the raw logs and unpacked data for RewardCollected events raised by the Labr contract. -type LabrRewardCollectedIterator struct { - Event *LabrRewardCollected // 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 *LabrRewardCollectedIterator) 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(LabrRewardCollected) - 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(LabrRewardCollected) - 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 *LabrRewardCollectedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrRewardCollectedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrRewardCollected represents a RewardCollected event raised by the Labr contract. -type LabrRewardCollected struct { - Relayer common.Address - Amount *big.Int - Raw types.Log // Blockchain specific contextual infos -} - -// FilterRewardCollected is a free log retrieval operation binding the contract event 0xe8354b169cd993d5cdfad1036a9a3f1ea7ed77e430bccb279200fd088243f595. -// -// Solidity: event RewardCollected(address relayer, uint256 amount) -func (_Labr *LabrFilterer) FilterRewardCollected(opts *bind.FilterOpts) (*LabrRewardCollectedIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "RewardCollected") - if err != nil { - return nil, err - } - return &LabrRewardCollectedIterator{contract: _Labr.contract, event: "RewardCollected", logs: logs, sub: sub}, nil -} - -// WatchRewardCollected is a free log subscription operation binding the contract event 0xe8354b169cd993d5cdfad1036a9a3f1ea7ed77e430bccb279200fd088243f595. -// -// Solidity: event RewardCollected(address relayer, uint256 amount) -func (_Labr *LabrFilterer) WatchRewardCollected(opts *bind.WatchOpts, sink chan<- *LabrRewardCollected) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "RewardCollected") - 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(LabrRewardCollected) - if err := _Labr.contract.UnpackLog(event, "RewardCollected", 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 -} - -// ParseRewardCollected is a log parse operation binding the contract event 0xe8354b169cd993d5cdfad1036a9a3f1ea7ed77e430bccb279200fd088243f595. -// -// Solidity: event RewardCollected(address relayer, uint256 amount) -func (_Labr *LabrFilterer) ParseRewardCollected(log types.Log) (*LabrRewardCollected, error) { - event := new(LabrRewardCollected) - if err := _Labr.contract.UnpackLog(event, "RewardCollected", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil -} - -// LabrUnpausedIterator is returned from FilterUnpaused and is used to iterate over the raw logs and unpacked data for Unpaused events raised by the Labr contract. -type LabrUnpausedIterator struct { - Event *LabrUnpaused // 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 *LabrUnpausedIterator) 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(LabrUnpaused) - 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(LabrUnpaused) - 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 *LabrUnpausedIterator) Error() error { - return it.fail -} - -// Close terminates the iteration process, releasing any pending underlying -// resources. -func (it *LabrUnpausedIterator) Close() error { - it.sub.Unsubscribe() - return nil -} - -// LabrUnpaused represents a Unpaused event raised by the Labr contract. -type LabrUnpaused struct { - Account common.Address - Raw types.Log // Blockchain specific contextual infos -} - -// FilterUnpaused is a free log retrieval operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. -// -// Solidity: event Unpaused(address account) -func (_Labr *LabrFilterer) FilterUnpaused(opts *bind.FilterOpts) (*LabrUnpausedIterator, error) { - - logs, sub, err := _Labr.contract.FilterLogs(opts, "Unpaused") - if err != nil { - return nil, err - } - return &LabrUnpausedIterator{contract: _Labr.contract, event: "Unpaused", logs: logs, sub: sub}, nil -} - -// WatchUnpaused is a free log subscription operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. -// -// Solidity: event Unpaused(address account) -func (_Labr *LabrFilterer) WatchUnpaused(opts *bind.WatchOpts, sink chan<- *LabrUnpaused) (event.Subscription, error) { - - logs, sub, err := _Labr.contract.WatchLogs(opts, "Unpaused") - 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(LabrUnpaused) - if err := _Labr.contract.UnpackLog(event, "Unpaused", 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 -} - -// ParseUnpaused is a log parse operation binding the contract event 0x5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa. -// -// Solidity: event Unpaused(address account) -func (_Labr *LabrFilterer) ParseUnpaused(log types.Log) (*LabrUnpaused, error) { - event := new(LabrUnpaused) - if err := _Labr.contract.UnpackLog(event, "Unpaused", log); err != nil { - return nil, err - } - event.Raw = log - return event, nil +// Solidity: function voteProposal(bytes8 originChainID, bytes8 destinationChainID, uint64 depositNonce, bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +func (_Labr *LabrTransactorSession) VoteProposal(originChainID [8]byte, destinationChainID [8]byte, depositNonce uint64, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _Labr.Contract.VoteProposal(&_Labr.TransactOpts, originChainID, destinationChainID, depositNonce, resourceID, recipientAddress, amount, params) } diff --git a/src/service/workers/eth-compatible/abi/handler/eth/Handler.go b/src/service/workers/eth-compatible/abi/handler/eth/Handler.go index c8b67c7..ebc4040 100644 --- a/src/service/workers/eth-compatible/abi/handler/eth/Handler.go +++ b/src/service/workers/eth-compatible/abi/handler/eth/Handler.go @@ -40,7 +40,7 @@ type ERC20HandlerDepositRecord struct { // EthHandlerMetaData contains all meta data concerning the EthHandler contract. var EthHandlerMetaData = &bind.MetaData{ - ABI: "[{\"name\":\"_bridgeAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_resourceIDToTokenContractAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_contractWhitelist\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"_burnList\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"setResource\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBurnable\",\"type\":\"function\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"_isInitialised\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"ownableInit\",\"type\":\"function\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"owner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"renounceOwnership\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"transferOwnership\",\"type\":\"function\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"implementation\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_dexAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_WETH\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_depositRecords\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"initialise\",\"type\":\"function\",\"inputs\":[{\"name\":\"initBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initDEXAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initWETHAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"ownerAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeBridgeAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeDEXAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newDEX\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeWETHAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newWETH\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"getDepositRecord\",\"type\":\"function\",\"inputs\":[{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destId\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"deposit\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"executeProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"withdraw\",\"type\":\"function\",\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"approve\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"transferExtraLA\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"OwnershipTransferred\",\"type\":\"event\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true},{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true}],\"anonymous\":false}]", + ABI: "[{\"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\":\"_bridgeAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_burnList\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_contractWhitelist\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes8\",\"name\":\"\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"name\":\"_depositRecords\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"internalType\":\"bytes8\",\"name\":\"_destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes32\",\"name\":\"_resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_destinationRecipientAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_depositer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"_isInitialised\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"_minDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"_resourceIDToTokenContractAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"_tokenContractAddressToResourceID\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newBridgeAddress\",\"type\":\"address\"}],\"name\":\"adminChangeBridgeAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"approve\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes8\",\"name\":\"destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"address\",\"name\":\"depositer\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"deposit\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositFunds\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"recipientAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"params\",\"type\":\"bytes\"}],\"name\":\"executeProposal\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"fundERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"}],\"name\":\"getAddressFromResourceId\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"depositNonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes8\",\"name\":\"destId\",\"type\":\"bytes8\"}],\"name\":\"getDepositRecord\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"_tokenAddress\",\"type\":\"address\"},{\"internalType\":\"bytes8\",\"name\":\"_destinationChainID\",\"type\":\"bytes8\"},{\"internalType\":\"bytes32\",\"name\":\"_resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"_destinationRecipientAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_depositer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"_amount\",\"type\":\"uint256\"}],\"internalType\":\"structERC20Handler.DepositRecord\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"}],\"name\":\"getMinDeposits\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"bridgeAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"ownableInit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"setBurnable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"uint256\",\"name\":\"minAmount\",\"type\":\"uint256\"}],\"name\":\"setMinDeposits\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"resourceID\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"contractAddress\",\"type\":\"address\"}],\"name\":\"setResource\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"tokenAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"recipient\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", } // EthHandlerABI is the input ABI used to generate the binding from. @@ -189,37 +189,6 @@ func (_EthHandler *EthHandlerTransactorRaw) Transact(opts *bind.TransactOpts, me return _EthHandler.Contract.contract.Transact(opts, method, params...) } -// WETH is a free data retrieval call binding the contract method 0xe0af3616. -// -// Solidity: function _WETH() view returns(address) -func (_EthHandler *EthHandlerCaller) WETH(opts *bind.CallOpts) (common.Address, error) { - var out []interface{} - err := _EthHandler.contract.Call(opts, &out, "_WETH") - - if err != nil { - return *new(common.Address), err - } - - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) - - return out0, err - -} - -// WETH is a free data retrieval call binding the contract method 0xe0af3616. -// -// Solidity: function _WETH() view returns(address) -func (_EthHandler *EthHandlerSession) WETH() (common.Address, error) { - return _EthHandler.Contract.WETH(&_EthHandler.CallOpts) -} - -// WETH is a free data retrieval call binding the contract method 0xe0af3616. -// -// Solidity: function _WETH() view returns(address) -func (_EthHandler *EthHandlerCallerSession) WETH() (common.Address, error) { - return _EthHandler.Contract.WETH(&_EthHandler.CallOpts) -} - // BridgeAddress is a free data retrieval call binding the contract method 0x318c136e. // // Solidity: function _bridgeAddress() view returns(address) @@ -315,95 +284,129 @@ func (_EthHandler *EthHandlerCallerSession) ContractWhitelist(arg0 common.Addres // DepositRecords is a free data retrieval call binding the contract method 0x78f6a94c. // -// Solidity: function _depositRecords(bytes8 , uint64 ) view returns((address,bytes8,bytes32,address,address,uint256)) -func (_EthHandler *EthHandlerCaller) DepositRecords(opts *bind.CallOpts, arg0 [8]byte, arg1 uint64) (ERC20HandlerDepositRecord, error) { +// Solidity: function _depositRecords(bytes8 , uint64 ) view returns(address _tokenAddress, bytes8 _destinationChainID, bytes32 _resourceID, address _destinationRecipientAddress, address _depositer, uint256 _amount) +func (_EthHandler *EthHandlerCaller) DepositRecords(opts *bind.CallOpts, arg0 [8]byte, arg1 uint64) (struct { + TokenAddress common.Address + DestinationChainID [8]byte + ResourceID [32]byte + DestinationRecipientAddress common.Address + Depositer common.Address + Amount *big.Int +}, error) { var out []interface{} err := _EthHandler.contract.Call(opts, &out, "_depositRecords", arg0, arg1) + outstruct := new(struct { + TokenAddress common.Address + DestinationChainID [8]byte + ResourceID [32]byte + DestinationRecipientAddress common.Address + Depositer common.Address + Amount *big.Int + }) if err != nil { - return *new(ERC20HandlerDepositRecord), err + return *outstruct, err } - out0 := *abi.ConvertType(out[0], new(ERC20HandlerDepositRecord)).(*ERC20HandlerDepositRecord) + outstruct.TokenAddress = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.DestinationChainID = *abi.ConvertType(out[1], new([8]byte)).(*[8]byte) + outstruct.ResourceID = *abi.ConvertType(out[2], new([32]byte)).(*[32]byte) + outstruct.DestinationRecipientAddress = *abi.ConvertType(out[3], new(common.Address)).(*common.Address) + outstruct.Depositer = *abi.ConvertType(out[4], new(common.Address)).(*common.Address) + outstruct.Amount = *abi.ConvertType(out[5], new(*big.Int)).(**big.Int) - return out0, err + return *outstruct, err } // DepositRecords is a free data retrieval call binding the contract method 0x78f6a94c. // -// Solidity: function _depositRecords(bytes8 , uint64 ) view returns((address,bytes8,bytes32,address,address,uint256)) -func (_EthHandler *EthHandlerSession) DepositRecords(arg0 [8]byte, arg1 uint64) (ERC20HandlerDepositRecord, error) { +// Solidity: function _depositRecords(bytes8 , uint64 ) view returns(address _tokenAddress, bytes8 _destinationChainID, bytes32 _resourceID, address _destinationRecipientAddress, address _depositer, uint256 _amount) +func (_EthHandler *EthHandlerSession) DepositRecords(arg0 [8]byte, arg1 uint64) (struct { + TokenAddress common.Address + DestinationChainID [8]byte + ResourceID [32]byte + DestinationRecipientAddress common.Address + Depositer common.Address + Amount *big.Int +}, error) { return _EthHandler.Contract.DepositRecords(&_EthHandler.CallOpts, arg0, arg1) } // DepositRecords is a free data retrieval call binding the contract method 0x78f6a94c. // -// Solidity: function _depositRecords(bytes8 , uint64 ) view returns((address,bytes8,bytes32,address,address,uint256)) -func (_EthHandler *EthHandlerCallerSession) DepositRecords(arg0 [8]byte, arg1 uint64) (ERC20HandlerDepositRecord, error) { +// Solidity: function _depositRecords(bytes8 , uint64 ) view returns(address _tokenAddress, bytes8 _destinationChainID, bytes32 _resourceID, address _destinationRecipientAddress, address _depositer, uint256 _amount) +func (_EthHandler *EthHandlerCallerSession) DepositRecords(arg0 [8]byte, arg1 uint64) (struct { + TokenAddress common.Address + DestinationChainID [8]byte + ResourceID [32]byte + DestinationRecipientAddress common.Address + Depositer common.Address + Amount *big.Int +}, error) { return _EthHandler.Contract.DepositRecords(&_EthHandler.CallOpts, arg0, arg1) } -// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. // -// Solidity: function _dexAddress() view returns(address) -func (_EthHandler *EthHandlerCaller) DexAddress(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function _isInitialised() view returns(bool) +func (_EthHandler *EthHandlerCaller) IsInitialised(opts *bind.CallOpts) (bool, error) { var out []interface{} - err := _EthHandler.contract.Call(opts, &out, "_dexAddress") + err := _EthHandler.contract.Call(opts, &out, "_isInitialised") if err != nil { - return *new(common.Address), err + return *new(bool), err } - out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) return out0, err } -// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. // -// Solidity: function _dexAddress() view returns(address) -func (_EthHandler *EthHandlerSession) DexAddress() (common.Address, error) { - return _EthHandler.Contract.DexAddress(&_EthHandler.CallOpts) +// Solidity: function _isInitialised() view returns(bool) +func (_EthHandler *EthHandlerSession) IsInitialised() (bool, error) { + return _EthHandler.Contract.IsInitialised(&_EthHandler.CallOpts) } -// DexAddress is a free data retrieval call binding the contract method 0x98bdd27a. +// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. // -// Solidity: function _dexAddress() view returns(address) -func (_EthHandler *EthHandlerCallerSession) DexAddress() (common.Address, error) { - return _EthHandler.Contract.DexAddress(&_EthHandler.CallOpts) +// Solidity: function _isInitialised() view returns(bool) +func (_EthHandler *EthHandlerCallerSession) IsInitialised() (bool, error) { + return _EthHandler.Contract.IsInitialised(&_EthHandler.CallOpts) } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// MinDeposits is a free data retrieval call binding the contract method 0xd90445ca. // -// Solidity: function _isInitialised() view returns(bool) -func (_EthHandler *EthHandlerCaller) IsInitialised(opts *bind.CallOpts) (bool, error) { +// Solidity: function _minDeposits(bytes32 ) view returns(uint256) +func (_EthHandler *EthHandlerCaller) MinDeposits(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { var out []interface{} - err := _EthHandler.contract.Call(opts, &out, "_isInitialised") + err := _EthHandler.contract.Call(opts, &out, "_minDeposits", arg0) if err != nil { - return *new(bool), err + return *new(*big.Int), err } - out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) return out0, err } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// MinDeposits is a free data retrieval call binding the contract method 0xd90445ca. // -// Solidity: function _isInitialised() view returns(bool) -func (_EthHandler *EthHandlerSession) IsInitialised() (bool, error) { - return _EthHandler.Contract.IsInitialised(&_EthHandler.CallOpts) +// Solidity: function _minDeposits(bytes32 ) view returns(uint256) +func (_EthHandler *EthHandlerSession) MinDeposits(arg0 [32]byte) (*big.Int, error) { + return _EthHandler.Contract.MinDeposits(&_EthHandler.CallOpts, arg0) } -// IsInitialised is a free data retrieval call binding the contract method 0xdd2e8ec3. +// MinDeposits is a free data retrieval call binding the contract method 0xd90445ca. // -// Solidity: function _isInitialised() view returns(bool) -func (_EthHandler *EthHandlerCallerSession) IsInitialised() (bool, error) { - return _EthHandler.Contract.IsInitialised(&_EthHandler.CallOpts) +// Solidity: function _minDeposits(bytes32 ) view returns(uint256) +func (_EthHandler *EthHandlerCallerSession) MinDeposits(arg0 [32]byte) (*big.Int, error) { + return _EthHandler.Contract.MinDeposits(&_EthHandler.CallOpts, arg0) } // ResourceIDToTokenContractAddress is a free data retrieval call binding the contract method 0x0a6d55d8. @@ -437,6 +440,68 @@ func (_EthHandler *EthHandlerCallerSession) ResourceIDToTokenContractAddress(arg return _EthHandler.Contract.ResourceIDToTokenContractAddress(&_EthHandler.CallOpts, arg0) } +// TokenContractAddressToResourceID is a free data retrieval call binding the contract method 0xc8ba6c87. +// +// Solidity: function _tokenContractAddressToResourceID(address ) view returns(bytes32) +func (_EthHandler *EthHandlerCaller) TokenContractAddressToResourceID(opts *bind.CallOpts, arg0 common.Address) ([32]byte, error) { + var out []interface{} + err := _EthHandler.contract.Call(opts, &out, "_tokenContractAddressToResourceID", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// TokenContractAddressToResourceID is a free data retrieval call binding the contract method 0xc8ba6c87. +// +// Solidity: function _tokenContractAddressToResourceID(address ) view returns(bytes32) +func (_EthHandler *EthHandlerSession) TokenContractAddressToResourceID(arg0 common.Address) ([32]byte, error) { + return _EthHandler.Contract.TokenContractAddressToResourceID(&_EthHandler.CallOpts, arg0) +} + +// TokenContractAddressToResourceID is a free data retrieval call binding the contract method 0xc8ba6c87. +// +// Solidity: function _tokenContractAddressToResourceID(address ) view returns(bytes32) +func (_EthHandler *EthHandlerCallerSession) TokenContractAddressToResourceID(arg0 common.Address) ([32]byte, error) { + return _EthHandler.Contract.TokenContractAddressToResourceID(&_EthHandler.CallOpts, arg0) +} + +// GetAddressFromResourceId is a free data retrieval call binding the contract method 0xa7a3fb40. +// +// Solidity: function getAddressFromResourceId(bytes32 resourceID) view returns(address) +func (_EthHandler *EthHandlerCaller) GetAddressFromResourceId(opts *bind.CallOpts, resourceID [32]byte) (common.Address, error) { + var out []interface{} + err := _EthHandler.contract.Call(opts, &out, "getAddressFromResourceId", resourceID) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetAddressFromResourceId is a free data retrieval call binding the contract method 0xa7a3fb40. +// +// Solidity: function getAddressFromResourceId(bytes32 resourceID) view returns(address) +func (_EthHandler *EthHandlerSession) GetAddressFromResourceId(resourceID [32]byte) (common.Address, error) { + return _EthHandler.Contract.GetAddressFromResourceId(&_EthHandler.CallOpts, resourceID) +} + +// GetAddressFromResourceId is a free data retrieval call binding the contract method 0xa7a3fb40. +// +// Solidity: function getAddressFromResourceId(bytes32 resourceID) view returns(address) +func (_EthHandler *EthHandlerCallerSession) GetAddressFromResourceId(resourceID [32]byte) (common.Address, error) { + return _EthHandler.Contract.GetAddressFromResourceId(&_EthHandler.CallOpts, resourceID) +} + // GetDepositRecord is a free data retrieval call binding the contract method 0x34143cd7. // // Solidity: function getDepositRecord(uint64 depositNonce, bytes8 destId) view returns((address,bytes8,bytes32,address,address,uint256)) @@ -468,35 +533,35 @@ func (_EthHandler *EthHandlerCallerSession) GetDepositRecord(depositNonce uint64 return _EthHandler.Contract.GetDepositRecord(&_EthHandler.CallOpts, depositNonce, destId) } -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// GetMinDeposits is a free data retrieval call binding the contract method 0x27e4b2f7. // -// Solidity: function implementation() view returns(address) -func (_EthHandler *EthHandlerCaller) Implementation(opts *bind.CallOpts) (common.Address, error) { +// Solidity: function getMinDeposits(bytes32 resourceID) view returns(uint256) +func (_EthHandler *EthHandlerCaller) GetMinDeposits(opts *bind.CallOpts, resourceID [32]byte) (*big.Int, error) { var out []interface{} - err := _EthHandler.contract.Call(opts, &out, "implementation") + err := _EthHandler.contract.Call(opts, &out, "getMinDeposits", resourceID) 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 } -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// GetMinDeposits is a free data retrieval call binding the contract method 0x27e4b2f7. // -// Solidity: function implementation() view returns(address) -func (_EthHandler *EthHandlerSession) Implementation() (common.Address, error) { - return _EthHandler.Contract.Implementation(&_EthHandler.CallOpts) +// Solidity: function getMinDeposits(bytes32 resourceID) view returns(uint256) +func (_EthHandler *EthHandlerSession) GetMinDeposits(resourceID [32]byte) (*big.Int, error) { + return _EthHandler.Contract.GetMinDeposits(&_EthHandler.CallOpts, resourceID) } -// Implementation is a free data retrieval call binding the contract method 0x5c60da1b. +// GetMinDeposits is a free data retrieval call binding the contract method 0x27e4b2f7. // -// Solidity: function implementation() view returns(address) -func (_EthHandler *EthHandlerCallerSession) Implementation() (common.Address, error) { - return _EthHandler.Contract.Implementation(&_EthHandler.CallOpts) +// Solidity: function getMinDeposits(bytes32 resourceID) view returns(uint256) +func (_EthHandler *EthHandlerCallerSession) GetMinDeposits(resourceID [32]byte) (*big.Int, error) { + return _EthHandler.Contract.GetMinDeposits(&_EthHandler.CallOpts, resourceID) } // Owner is a free data retrieval call binding the contract method 0x8da5cb5b. @@ -551,48 +616,6 @@ func (_EthHandler *EthHandlerTransactorSession) AdminChangeBridgeAddress(newBrid return _EthHandler.Contract.AdminChangeBridgeAddress(&_EthHandler.TransactOpts, newBridgeAddress) } -// AdminChangeDEXAddress is a paid mutator transaction binding the contract method 0x311e0c67. -// -// Solidity: function adminChangeDEXAddress(address newDEX) returns() -func (_EthHandler *EthHandlerTransactor) AdminChangeDEXAddress(opts *bind.TransactOpts, newDEX common.Address) (*types.Transaction, error) { - return _EthHandler.contract.Transact(opts, "adminChangeDEXAddress", newDEX) -} - -// AdminChangeDEXAddress is a paid mutator transaction binding the contract method 0x311e0c67. -// -// Solidity: function adminChangeDEXAddress(address newDEX) returns() -func (_EthHandler *EthHandlerSession) AdminChangeDEXAddress(newDEX common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.AdminChangeDEXAddress(&_EthHandler.TransactOpts, newDEX) -} - -// AdminChangeDEXAddress is a paid mutator transaction binding the contract method 0x311e0c67. -// -// Solidity: function adminChangeDEXAddress(address newDEX) returns() -func (_EthHandler *EthHandlerTransactorSession) AdminChangeDEXAddress(newDEX common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.AdminChangeDEXAddress(&_EthHandler.TransactOpts, newDEX) -} - -// AdminChangeWETHAddress is a paid mutator transaction binding the contract method 0xf6eb24fa. -// -// Solidity: function adminChangeWETHAddress(address newWETH) returns() -func (_EthHandler *EthHandlerTransactor) AdminChangeWETHAddress(opts *bind.TransactOpts, newWETH common.Address) (*types.Transaction, error) { - return _EthHandler.contract.Transact(opts, "adminChangeWETHAddress", newWETH) -} - -// AdminChangeWETHAddress is a paid mutator transaction binding the contract method 0xf6eb24fa. -// -// Solidity: function adminChangeWETHAddress(address newWETH) returns() -func (_EthHandler *EthHandlerSession) AdminChangeWETHAddress(newWETH common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.AdminChangeWETHAddress(&_EthHandler.TransactOpts, newWETH) -} - -// AdminChangeWETHAddress is a paid mutator transaction binding the contract method 0xf6eb24fa. -// -// Solidity: function adminChangeWETHAddress(address newWETH) returns() -func (_EthHandler *EthHandlerTransactorSession) AdminChangeWETHAddress(newWETH common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.AdminChangeWETHAddress(&_EthHandler.TransactOpts, newWETH) -} - // Approve is a paid mutator transaction binding the contract method 0xbf1ed1eb. // // Solidity: function approve(bytes32 resourceID, address spender, uint256 amount) returns() @@ -635,67 +658,109 @@ func (_EthHandler *EthHandlerTransactorSession) Deposit(resourceID [32]byte, des return _EthHandler.Contract.Deposit(&_EthHandler.TransactOpts, resourceID, destinationChainID, depositNonce, depositer, recipientAddress, amount, params) } +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_EthHandler *EthHandlerTransactor) DepositFunds(opts *bind.TransactOpts) (*types.Transaction, error) { + return _EthHandler.contract.Transact(opts, "depositFunds") +} + +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_EthHandler *EthHandlerSession) DepositFunds() (*types.Transaction, error) { + return _EthHandler.Contract.DepositFunds(&_EthHandler.TransactOpts) +} + +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_EthHandler *EthHandlerTransactorSession) DepositFunds() (*types.Transaction, error) { + return _EthHandler.Contract.DepositFunds(&_EthHandler.TransactOpts) +} + // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_EthHandler *EthHandlerTransactor) ExecuteProposal(opts *bind.TransactOpts, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _EthHandler.contract.Transact(opts, "executeProposal", resourceID, recipientAddress, amount, params) } // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_EthHandler *EthHandlerSession) ExecuteProposal(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _EthHandler.Contract.ExecuteProposal(&_EthHandler.TransactOpts, resourceID, recipientAddress, amount, params) } // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_EthHandler *EthHandlerTransactorSession) ExecuteProposal(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _EthHandler.Contract.ExecuteProposal(&_EthHandler.TransactOpts, resourceID, recipientAddress, amount, params) } -// Initialise is a paid mutator transaction binding the contract method 0x994731da. +// FundERC20 is a paid mutator transaction binding the contract method 0x95601f09. +// +// Solidity: function fundERC20(address tokenAddress, address owner, uint256 amount) returns() +func (_EthHandler *EthHandlerTransactor) FundERC20(opts *bind.TransactOpts, tokenAddress common.Address, owner common.Address, amount *big.Int) (*types.Transaction, error) { + return _EthHandler.contract.Transact(opts, "fundERC20", tokenAddress, owner, amount) +} + +// FundERC20 is a paid mutator transaction binding the contract method 0x95601f09. +// +// Solidity: function fundERC20(address tokenAddress, address owner, uint256 amount) returns() +func (_EthHandler *EthHandlerSession) FundERC20(tokenAddress common.Address, owner common.Address, amount *big.Int) (*types.Transaction, error) { + return _EthHandler.Contract.FundERC20(&_EthHandler.TransactOpts, tokenAddress, owner, amount) +} + +// FundERC20 is a paid mutator transaction binding the contract method 0x95601f09. +// +// Solidity: function fundERC20(address tokenAddress, address owner, uint256 amount) returns() +func (_EthHandler *EthHandlerTransactorSession) FundERC20(tokenAddress common.Address, owner common.Address, amount *big.Int) (*types.Transaction, error) { + return _EthHandler.Contract.FundERC20(&_EthHandler.TransactOpts, tokenAddress, owner, amount) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // -// Solidity: function initialise(address initBridgeAddress, address initDEXAddress, address initWETHAddress, address ownerAddress) returns() -func (_EthHandler *EthHandlerTransactor) Initialise(opts *bind.TransactOpts, initBridgeAddress common.Address, initDEXAddress common.Address, initWETHAddress common.Address, ownerAddress common.Address) (*types.Transaction, error) { - return _EthHandler.contract.Transact(opts, "initialise", initBridgeAddress, initDEXAddress, initWETHAddress, ownerAddress) +// Solidity: function initialize(address bridgeAddress) returns() +func (_EthHandler *EthHandlerTransactor) Initialize(opts *bind.TransactOpts, bridgeAddress common.Address) (*types.Transaction, error) { + return _EthHandler.contract.Transact(opts, "initialize", bridgeAddress) } -// Initialise is a paid mutator transaction binding the contract method 0x994731da. +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // -// Solidity: function initialise(address initBridgeAddress, address initDEXAddress, address initWETHAddress, address ownerAddress) returns() -func (_EthHandler *EthHandlerSession) Initialise(initBridgeAddress common.Address, initDEXAddress common.Address, initWETHAddress common.Address, ownerAddress common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.Initialise(&_EthHandler.TransactOpts, initBridgeAddress, initDEXAddress, initWETHAddress, ownerAddress) +// Solidity: function initialize(address bridgeAddress) returns() +func (_EthHandler *EthHandlerSession) Initialize(bridgeAddress common.Address) (*types.Transaction, error) { + return _EthHandler.Contract.Initialize(&_EthHandler.TransactOpts, bridgeAddress) } -// Initialise is a paid mutator transaction binding the contract method 0x994731da. +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. // -// Solidity: function initialise(address initBridgeAddress, address initDEXAddress, address initWETHAddress, address ownerAddress) returns() -func (_EthHandler *EthHandlerTransactorSession) Initialise(initBridgeAddress common.Address, initDEXAddress common.Address, initWETHAddress common.Address, ownerAddress common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.Initialise(&_EthHandler.TransactOpts, initBridgeAddress, initDEXAddress, initWETHAddress, ownerAddress) +// Solidity: function initialize(address bridgeAddress) returns() +func (_EthHandler *EthHandlerTransactorSession) Initialize(bridgeAddress common.Address) (*types.Transaction, error) { + return _EthHandler.Contract.Initialize(&_EthHandler.TransactOpts, bridgeAddress) } // OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. // -// Solidity: function ownableInit(address owner_) returns() -func (_EthHandler *EthHandlerTransactor) OwnableInit(opts *bind.TransactOpts, owner_ common.Address) (*types.Transaction, error) { - return _EthHandler.contract.Transact(opts, "ownableInit", owner_) +// Solidity: function ownableInit(address owner) returns() +func (_EthHandler *EthHandlerTransactor) OwnableInit(opts *bind.TransactOpts, owner common.Address) (*types.Transaction, error) { + return _EthHandler.contract.Transact(opts, "ownableInit", owner) } // OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. // -// Solidity: function ownableInit(address owner_) returns() -func (_EthHandler *EthHandlerSession) OwnableInit(owner_ common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.OwnableInit(&_EthHandler.TransactOpts, owner_) +// Solidity: function ownableInit(address owner) returns() +func (_EthHandler *EthHandlerSession) OwnableInit(owner common.Address) (*types.Transaction, error) { + return _EthHandler.Contract.OwnableInit(&_EthHandler.TransactOpts, owner) } // OwnableInit is a paid mutator transaction binding the contract method 0xea439b2b. // -// Solidity: function ownableInit(address owner_) returns() -func (_EthHandler *EthHandlerTransactorSession) OwnableInit(owner_ common.Address) (*types.Transaction, error) { - return _EthHandler.Contract.OwnableInit(&_EthHandler.TransactOpts, owner_) +// Solidity: function ownableInit(address owner) returns() +func (_EthHandler *EthHandlerTransactorSession) OwnableInit(owner common.Address) (*types.Transaction, error) { + return _EthHandler.Contract.OwnableInit(&_EthHandler.TransactOpts, owner) } // RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. @@ -740,6 +805,27 @@ func (_EthHandler *EthHandlerTransactorSession) SetBurnable(contractAddress comm return _EthHandler.Contract.SetBurnable(&_EthHandler.TransactOpts, contractAddress) } +// SetMinDeposits is a paid mutator transaction binding the contract method 0x06a6906c. +// +// Solidity: function setMinDeposits(bytes32 resourceID, uint256 minAmount) returns() +func (_EthHandler *EthHandlerTransactor) SetMinDeposits(opts *bind.TransactOpts, resourceID [32]byte, minAmount *big.Int) (*types.Transaction, error) { + return _EthHandler.contract.Transact(opts, "setMinDeposits", resourceID, minAmount) +} + +// SetMinDeposits is a paid mutator transaction binding the contract method 0x06a6906c. +// +// Solidity: function setMinDeposits(bytes32 resourceID, uint256 minAmount) returns() +func (_EthHandler *EthHandlerSession) SetMinDeposits(resourceID [32]byte, minAmount *big.Int) (*types.Transaction, error) { + return _EthHandler.Contract.SetMinDeposits(&_EthHandler.TransactOpts, resourceID, minAmount) +} + +// SetMinDeposits is a paid mutator transaction binding the contract method 0x06a6906c. +// +// Solidity: function setMinDeposits(bytes32 resourceID, uint256 minAmount) returns() +func (_EthHandler *EthHandlerTransactorSession) SetMinDeposits(resourceID [32]byte, minAmount *big.Int) (*types.Transaction, error) { + return _EthHandler.Contract.SetMinDeposits(&_EthHandler.TransactOpts, resourceID, minAmount) +} + // SetResource is a paid mutator transaction binding the contract method 0xb8fa3736. // // Solidity: function setResource(bytes32 resourceID, address contractAddress) returns() @@ -761,27 +847,6 @@ func (_EthHandler *EthHandlerTransactorSession) SetResource(resourceID [32]byte, return _EthHandler.Contract.SetResource(&_EthHandler.TransactOpts, resourceID, contractAddress) } -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. -// -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_EthHandler *EthHandlerTransactor) TransferExtraLA(opts *bind.TransactOpts, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _EthHandler.contract.Transact(opts, "transferExtraLA", resourceID, recipientAddress, amount) -} - -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. -// -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_EthHandler *EthHandlerSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _EthHandler.Contract.TransferExtraLA(&_EthHandler.TransactOpts, resourceID, recipientAddress, amount) -} - -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. -// -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_EthHandler *EthHandlerTransactorSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _EthHandler.Contract.TransferExtraLA(&_EthHandler.TransactOpts, resourceID, recipientAddress, amount) -} - // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. // // Solidity: function transferOwnership(address newOwner) returns() diff --git a/src/service/workers/eth-compatible/abi/handler/la/Handler.go b/src/service/workers/eth-compatible/abi/handler/la/Handler.go index ce0f28e..c975132 100644 --- a/src/service/workers/eth-compatible/abi/handler/la/Handler.go +++ b/src/service/workers/eth-compatible/abi/handler/la/Handler.go @@ -40,7 +40,7 @@ type ERC20HandlerDepositRecord struct { // LaHandlerMetaData contains all meta data concerning the LaHandler contract. var LaHandlerMetaData = &bind.MetaData{ - ABI: "[{\"name\":\"_bridgeAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_resourceIDToTokenContractAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_contractWhitelist\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"_burnList\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"setResource\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBurnable\",\"type\":\"function\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"_isInitialised\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"ownableInit\",\"type\":\"function\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"owner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"renounceOwnership\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"transferOwnership\",\"type\":\"function\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"implementation\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"proxyOwner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_dexAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_WETH\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_depositRecords\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"initialise\",\"type\":\"function\",\"inputs\":[{\"name\":\"initBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initDEXAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initWETHAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"ownerAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeBridgeAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeDEXAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newDEX\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeWETHAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newWETH\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"getDepositRecord\",\"type\":\"function\",\"inputs\":[{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destId\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"deposit\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"executeProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"withdraw\",\"type\":\"function\",\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"approve\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"transferExtraLA\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"OwnershipTransferred\",\"type\":\"event\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true},{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true}],\"anonymous\":false}]", + ABI: "[{\"name\":\"_bridgeAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_resourceIDToTokenContractAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_contractWhitelist\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"_burnList\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"setResource\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"setBurnable\",\"type\":\"function\",\"inputs\":[{\"name\":\"contractAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"_isInitialised\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"view\"},{\"name\":\"ownableInit\",\"type\":\"function\",\"inputs\":[{\"name\":\"owner_\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"owner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"transferOwnership\",\"type\":\"function\",\"inputs\":[{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"implementation\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"proxyOwner\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_dexAddress\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_WETH\",\"type\":\"function\",\"inputs\":[],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"}],\"stateMutability\":\"view\"},{\"name\":\"_depositRecords\",\"type\":\"function\",\"inputs\":[{\"name\":\"\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"\",\"type\":\"uint64\",\"internalType\":\"uint64\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"initialise\",\"type\":\"function\",\"inputs\":[{\"name\":\"initBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initDEXAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"initWETHAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"ownerAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeBridgeAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newBridgeAddress\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeDEXAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newDEX\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"adminChangeWETHAddress\",\"type\":\"function\",\"inputs\":[{\"name\":\"newWETH\",\"type\":\"address\",\"internalType\":\"address\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"getDepositRecord\",\"type\":\"function\",\"inputs\":[{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"destId\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"}],\"outputs\":[{\"name\":\"\",\"type\":\"tuple\",\"internalType\":\"structERC20Handler.DepositRecord\",\"components\":[{\"name\":\"_tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"_resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"_destinationRecipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"_amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}]}],\"stateMutability\":\"view\"},{\"name\":\"deposit\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"destinationChainID\",\"type\":\"bytes8\",\"internalType\":\"bytes8\"},{\"name\":\"depositNonce\",\"type\":\"uint64\",\"internalType\":\"uint64\"},{\"name\":\"depositer\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"executeProposal\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"withdraw\",\"type\":\"function\",\"inputs\":[{\"name\":\"tokenAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"recipient\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"depositFunds\",\"type\":\"function\",\"inputs\":[],\"outputs\":[],\"stateMutability\":\"payable\"},{\"name\":\"approve\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"spender\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"}],\"outputs\":[],\"stateMutability\":\"nonpayable\"},{\"name\":\"transferExtraLA\",\"type\":\"function\",\"inputs\":[{\"name\":\"resourceID\",\"type\":\"bytes32\",\"internalType\":\"bytes32\"},{\"name\":\"recipientAddress\",\"type\":\"address\",\"internalType\":\"address\"},{\"name\":\"amount\",\"type\":\"uint256\",\"internalType\":\"uint256\"},{\"name\":\"params\",\"type\":\"bytes\",\"internalType\":\"bytes\"}],\"outputs\":[{\"name\":\"\",\"type\":\"bool\",\"internalType\":\"bool\"}],\"stateMutability\":\"nonpayable\"},{\"name\":\"OwnershipTransferred\",\"type\":\"event\",\"inputs\":[{\"name\":\"previousOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true},{\"name\":\"newOwner\",\"type\":\"address\",\"internalType\":\"address\",\"indexed\":true}],\"anonymous\":false}]", } // LaHandlerABI is the input ABI used to generate the binding from. @@ -666,23 +666,44 @@ func (_LaHandler *LaHandlerTransactorSession) Deposit(resourceID [32]byte, desti return _LaHandler.Contract.Deposit(&_LaHandler.TransactOpts, resourceID, destinationChainID, depositNonce, depositer, recipientAddress, amount, params) } +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_LaHandler *LaHandlerTransactor) DepositFunds(opts *bind.TransactOpts) (*types.Transaction, error) { + return _LaHandler.contract.Transact(opts, "depositFunds") +} + +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_LaHandler *LaHandlerSession) DepositFunds() (*types.Transaction, error) { + return _LaHandler.Contract.DepositFunds(&_LaHandler.TransactOpts) +} + +// DepositFunds is a paid mutator transaction binding the contract method 0xe2c41dbc. +// +// Solidity: function depositFunds() payable returns() +func (_LaHandler *LaHandlerTransactorSession) DepositFunds() (*types.Transaction, error) { + return _LaHandler.Contract.DepositFunds(&_LaHandler.TransactOpts) +} + // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_LaHandler *LaHandlerTransactor) ExecuteProposal(opts *bind.TransactOpts, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _LaHandler.contract.Transact(opts, "executeProposal", resourceID, recipientAddress, amount, params) } // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_LaHandler *LaHandlerSession) ExecuteProposal(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _LaHandler.Contract.ExecuteProposal(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount, params) } // ExecuteProposal is a paid mutator transaction binding the contract method 0x728e218f. // -// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns() +// Solidity: function executeProposal(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(uint256) func (_LaHandler *LaHandlerTransactorSession) ExecuteProposal(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { return _LaHandler.Contract.ExecuteProposal(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount, params) } @@ -729,27 +750,6 @@ func (_LaHandler *LaHandlerTransactorSession) OwnableInit(owner_ common.Address) return _LaHandler.Contract.OwnableInit(&_LaHandler.TransactOpts, owner_) } -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LaHandler *LaHandlerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { - return _LaHandler.contract.Transact(opts, "renounceOwnership") -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LaHandler *LaHandlerSession) RenounceOwnership() (*types.Transaction, error) { - return _LaHandler.Contract.RenounceOwnership(&_LaHandler.TransactOpts) -} - -// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. -// -// Solidity: function renounceOwnership() returns() -func (_LaHandler *LaHandlerTransactorSession) RenounceOwnership() (*types.Transaction, error) { - return _LaHandler.Contract.RenounceOwnership(&_LaHandler.TransactOpts) -} - // SetBurnable is a paid mutator transaction binding the contract method 0x07b7ed99. // // Solidity: function setBurnable(address contractAddress) returns() @@ -792,25 +792,25 @@ func (_LaHandler *LaHandlerTransactorSession) SetResource(resourceID [32]byte, c return _LaHandler.Contract.SetResource(&_LaHandler.TransactOpts, resourceID, contractAddress) } -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. +// TransferExtraLA is a paid mutator transaction binding the contract method 0x9488e9fb. // -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_LaHandler *LaHandlerTransactor) TransferExtraLA(opts *bind.TransactOpts, resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _LaHandler.contract.Transact(opts, "transferExtraLA", resourceID, recipientAddress, amount) +// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(bool) +func (_LaHandler *LaHandlerTransactor) TransferExtraLA(opts *bind.TransactOpts, resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _LaHandler.contract.Transact(opts, "transferExtraLA", resourceID, recipientAddress, amount, params) } -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. +// TransferExtraLA is a paid mutator transaction binding the contract method 0x9488e9fb. // -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_LaHandler *LaHandlerSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _LaHandler.Contract.TransferExtraLA(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount) +// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(bool) +func (_LaHandler *LaHandlerSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _LaHandler.Contract.TransferExtraLA(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount, params) } -// TransferExtraLA is a paid mutator transaction binding the contract method 0x3b926694. +// TransferExtraLA is a paid mutator transaction binding the contract method 0x9488e9fb. // -// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount) returns(bool) -func (_LaHandler *LaHandlerTransactorSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int) (*types.Transaction, error) { - return _LaHandler.Contract.TransferExtraLA(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount) +// Solidity: function transferExtraLA(bytes32 resourceID, address recipientAddress, uint256 amount, bytes params) returns(bool) +func (_LaHandler *LaHandlerTransactorSession) TransferExtraLA(resourceID [32]byte, recipientAddress common.Address, amount *big.Int, params []byte) (*types.Transaction, error) { + return _LaHandler.Contract.TransferExtraLA(&_LaHandler.TransactOpts, resourceID, recipientAddress, amount, params) } // TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. diff --git a/src/service/workers/eth-compatible/erc20-worker.go b/src/service/workers/eth-compatible/erc20-worker.go index a03f4e1..cebd144 100644 --- a/src/service/workers/eth-compatible/erc20-worker.go +++ b/src/service/workers/eth-compatible/erc20-worker.go @@ -223,7 +223,7 @@ func (w *Erc20Worker) GetHeight() (int64, error) { } // Vote ... -func (w *Erc20Worker) Vote(depositNonce uint64, originchainID [8]byte, destinationChainID [8]byte, resourceID [32]byte, receiptAddr string, amount string) (string, string, error) { +func (w *Erc20Worker) Vote(depositNonce uint64, originchainID [8]byte, destinationChainID [8]byte, resourceID [32]byte, stepIndex uint8, receiptAddr string, amount string) (string, string, error) { auth, err := w.getTransactor() if err != nil { return "", "", err @@ -235,7 +235,7 @@ func (w *Erc20Worker) Vote(depositNonce uint64, originchainID [8]byte, destinati } value, _ := new(big.Int).SetString(amount, 10) - tx, err := instance.VoteProposal(auth, originchainID, destinationChainID, depositNonce, resourceID, common.HexToAddress(receiptAddr), value) + tx, err := instance.VoteProposal(auth, originchainID, destinationChainID, depositNonce, resourceID, common.HexToAddress(receiptAddr), value, []byte{stepIndex}) if err != nil { return "", "", err } diff --git a/src/service/workers/eth-compatible/types.go b/src/service/workers/eth-compatible/types.go index 1e270b8..f8eac5d 100644 --- a/src/service/workers/eth-compatible/types.go +++ b/src/service/workers/eth-compatible/types.go @@ -72,6 +72,7 @@ func (ev DepositEvent) ToTxLog() *storage.TxLog { OriginСhainID: common.Bytes2Hex(ev.OriginChainID[:]), SwapID: utils.CalcutateSwapID(common.Bytes2Hex(ev.OriginChainID[:]), common.Bytes2Hex(ev.DestinationChainID[:]), fmt.Sprint(ev.DepositNonce)), ResourceID: common.Bytes2Hex(ev.ResourceID[:]), + StepIndex: ev.Params[0], DepositNonce: ev.DepositNonce, SenderAddr: ev.Depositor.Hex(), ReceiverAddr: ev.RecipientAddress.Hex(), diff --git a/src/service/workers/utils/utils.go b/src/service/workers/utils/utils.go index 3ee7b2d..18453e6 100644 --- a/src/service/workers/utils/utils.go +++ b/src/service/workers/utils/utils.go @@ -2,7 +2,6 @@ package utils import ( "crypto/ecdsa" - "encoding/hex" "math" "math/big" @@ -85,13 +84,6 @@ func ConvertDecimals(originDecimals, destDecimals uint8, amount string) string { return new(big.Int).Quo(new(big.Int).Mul(amountInFloat, dest), origin).String() } -func GetGasSwapResourceIDs(resourceID string) (destResourceID, originResourceID string) { - swapIdentifier := hex.EncodeToString([]byte("swap")) - if resourceID[:8] == swapIdentifier { - originResourceID = "00000000000000000000000000000000000000000000" + resourceID[44:] - destResourceID = "00000000000000000000000000000000000000000000" + resourceID[24:44] - return destResourceID, originResourceID - } else { - return resourceID, resourceID - } +func GetCurrentStep(resourceID string, stepIndex uint8) string { + return resourceID[16*stepIndex:16*stepIndex+8] + "00000000000000000000000000000000000000000000000000000000" } diff --git a/src/service/workers/worker.go b/src/service/workers/worker.go index 85881d7..0d8e9c2 100644 --- a/src/service/workers/worker.go +++ b/src/service/workers/worker.go @@ -54,5 +54,5 @@ type IWorker interface { // CreateRequest sends wrapped tokens tx // CreateRequest(swapID common.Hash) (string, error) // Vote - Vote(depositNonce uint64, originChainID [8]byte, destinationChainID [8]byte, resourceID [32]byte, receiptAddr string, amount string) (string, string, error) + Vote(depositNonce uint64, originChainID [8]byte, destinationChainID [8]byte, resourceID [32]byte, stepIndex uint8, receiptAddr string, amount string) (string, string, error) }