From e6e6c49122b9f1664af10b47128d60da5fdb373d Mon Sep 17 00:00:00 2001 From: martonp Date: Mon, 3 Jun 2024 14:42:37 +0800 Subject: [PATCH] multi: USDC Bridge between eth and polygon Implements the CCTP protocol to bridge native USDC between eth and polygon. --- client/asset/eth/eth.go | 296 +- client/asset/eth/eth_test.go | 16 +- client/asset/eth/usdc_bridge.go | 289 ++ client/asset/interface.go | 11 + client/core/core.go | 110 + client/core/wallet.go | 58 + client/rpcserver/handlers.go | 185 ++ client/rpcserver/rpcserver.go | 6 + client/rpcserver/rpcserver_test.go | 18 + client/webserver/jsintl.go | 4 + client/webserver/site/src/js/locales.ts | 2 + client/webserver/site/src/js/wallets.ts | 12 +- dex/msgjson/types.go | 1 + dex/networks/erc20/cctp/MessageTransmitter.go | 2844 +++++++++++++++++ .../erc20/cctp/MessageTransmitter.json | 707 ++++ dex/networks/erc20/cctp/TokenMessenger.go | 1963 ++++++++++++ dex/networks/erc20/cctp/TokenMessenger.json | 547 ++++ dex/networks/erc20/cctp/genfiles.sh | 2 + 18 files changed, 7040 insertions(+), 31 deletions(-) create mode 100644 client/asset/eth/usdc_bridge.go create mode 100644 dex/networks/erc20/cctp/MessageTransmitter.go create mode 100644 dex/networks/erc20/cctp/MessageTransmitter.json create mode 100644 dex/networks/erc20/cctp/TokenMessenger.go create mode 100644 dex/networks/erc20/cctp/TokenMessenger.json create mode 100644 dex/networks/erc20/cctp/genfiles.sh diff --git a/client/asset/eth/eth.go b/client/asset/eth/eth.go index 261b6748f1..fd39a8a7ad 100644 --- a/client/asset/eth/eth.go +++ b/client/asset/eth/eth.go @@ -505,8 +505,8 @@ type assetWallet struct { findRedemptionReqs map[[32]byte]*findRedemptionRequest approvalsMtx sync.RWMutex - pendingApprovals map[uint32]*pendingApproval - approvalCache map[uint32]bool + pendingApprovals map[common.Address]*pendingApproval + approvalCache map[common.Address]bool lastPeerCount uint32 peersChange func(uint32, error) @@ -804,8 +804,8 @@ func NewEVMWallet(cfg *EVMWalletConfig) (w *ETHWallet, err error) { maxRedeemGas: maxRedeemGas, emit: cfg.AssetCfg.Emit, findRedemptionReqs: make(map[[32]byte]*findRedemptionRequest), - pendingApprovals: make(map[uint32]*pendingApproval), - approvalCache: make(map[uint32]bool), + pendingApprovals: make(map[common.Address]*pendingApproval), + approvalCache: make(map[common.Address]bool), peersChange: cfg.AssetCfg.PeersChange, contractors: make(map[uint32]contractor), evmify: dexeth.GweiToWei, @@ -1000,6 +1000,17 @@ func (w *TokenWallet) Connect(ctx context.Context) (*sync.WaitGroup, error) { return &wg, nil } +func (w *BridgeWallet) Connect(ctx context.Context) (*sync.WaitGroup, error) { + bridge, err := newUsdcBrdge(w.assetID, w.net, w.netToken.Address, w.node.contractBackend()) + if err != nil { + return nil, err + } + + w.bridge = bridge + + return w.TokenWallet.Connect(ctx) +} + // tipHeight gets the current best header's tip height. func (w *baseWallet) tipHeight() uint64 { w.tipMtx.RLock() @@ -1214,6 +1225,14 @@ func (w *baseWallet) CreateTokenWallet(tokenID uint32, _ map[string]string) erro return nil } +type BridgeWallet struct { + bridge *usdcBridge + + *TokenWallet +} + +var _ asset.Bridger = (*BridgeWallet)(nil) + // OpenTokenWallet creates a new TokenWallet. func (w *ETHWallet) OpenTokenWallet(tokenCfg *asset.TokenConfig) (asset.Wallet, error) { token, found := w.tokens[tokenCfg.AssetID] @@ -1268,8 +1287,8 @@ func (w *ETHWallet) OpenTokenWallet(tokenCfg *asset.TokenConfig) (asset.Wallet, emit: tokenCfg.Emit, peersChange: tokenCfg.PeersChange, findRedemptionReqs: make(map[[32]byte]*findRedemptionRequest), - pendingApprovals: make(map[uint32]*pendingApproval), - approvalCache: make(map[uint32]bool), + pendingApprovals: make(map[common.Address]*pendingApproval), + approvalCache: make(map[common.Address]bool), contractors: make(map[uint32]contractor), evmify: token.AtomicToEVM, atomize: token.EVMToAtomic, @@ -1287,13 +1306,23 @@ func (w *ETHWallet) OpenTokenWallet(tokenCfg *asset.TokenConfig) (asset.Wallet, w.baseWallet.wallets[tokenCfg.AssetID] = aw w.baseWallet.walletsMtx.Unlock() - return &TokenWallet{ + tokenWallet := &TokenWallet{ assetWallet: aw, cfg: cfg, parent: w.assetWallet, token: token, netToken: netToken, - }, nil + } + + fmt.Println("~~~~~~", tokenCfg.AssetID, usdcEthID, usdcPolygonID) + if tokenCfg.AssetID == usdcEthID || tokenCfg.AssetID == usdcPolygonID { + fmt.Println("returning bridge wallet") + return &BridgeWallet{ + TokenWallet: tokenWallet, + }, nil + } + + return tokenWallet, nil } // OwnsDepositAddress indicates if an address belongs to the wallet. The address @@ -1694,7 +1723,7 @@ func (w *TokenWallet) FundOrder(ord *asset.Order) (asset.Coins, []dex.Bytes, uin dex.BipIDSymbol(w.assetID), ord.MaxFeeRate, w.gasFeeLimit()) } - approvalStatus, err := w.approvalStatus(ord.Version) + approvalStatus, err := w.tokenSwapContractApprovalStatus(ord.Version) if err != nil { return nil, nil, 0, fmt.Errorf("error getting approval status: %v", err) } @@ -1779,7 +1808,7 @@ func (w *TokenWallet) FundMultiOrder(ord *asset.MultiOrder, maxLock uint64) ([]a dex.BipIDSymbol(w.assetID), ord.MaxFeeRate, w.gasFeeLimit()) } - approvalStatus, err := w.approvalStatus(ord.Version) + approvalStatus, err := w.tokenSwapContractApprovalStatus(ord.Version) if err != nil { return nil, nil, 0, fmt.Errorf("error getting approval status: %v", err) } @@ -2537,7 +2566,7 @@ func (w *assetWallet) approveToken(ctx context.Context, amount *big.Int, gasLimi }) } -func (w *assetWallet) approvalStatus(version uint32) (asset.ApprovalStatus, error) { +func (w *assetWallet) approvalStatus(contract common.Address, checkAllowance func() (*big.Int, error)) (asset.ApprovalStatus, error) { if w.assetID == w.baseChainID { return asset.Approved, nil } @@ -2545,7 +2574,7 @@ func (w *assetWallet) approvalStatus(version uint32) (asset.ApprovalStatus, erro // If the result has been cached, return what is in the cache. // The cache is cleared if an approval/unapproval tx is done. w.approvalsMtx.RLock() - if approved, cached := w.approvalCache[version]; cached { + if approved, cached := w.approvalCache[contract]; cached { w.approvalsMtx.RUnlock() if approved { return asset.Approved, nil @@ -2554,7 +2583,7 @@ func (w *assetWallet) approvalStatus(version uint32) (asset.ApprovalStatus, erro } } - if _, pending := w.pendingApprovals[version]; pending { + if _, pending := w.pendingApprovals[contract]; pending { w.approvalsMtx.RUnlock() return asset.Pending, nil } @@ -2563,24 +2592,39 @@ func (w *assetWallet) approvalStatus(version uint32) (asset.ApprovalStatus, erro w.approvalsMtx.Lock() defer w.approvalsMtx.Unlock() - currentAllowance, err := w.tokenAllowance(version) + currentAllowance, err := checkAllowance() if err != nil { return asset.NotApproved, fmt.Errorf("error retrieving current allowance: %w", err) } if currentAllowance.Cmp(unlimitedAllowanceReplenishThreshold) >= 0 { - w.approvalCache[version] = true + w.approvalCache[contract] = true return asset.Approved, nil } - w.approvalCache[version] = false + w.approvalCache[contract] = false return asset.NotApproved, nil } +func (w *TokenWallet) tokenSwapContractApprovalStatus(assetVer uint32) (asset.ApprovalStatus, error) { + contract, found := w.versionedContracts[assetVer] + if !found { + return asset.NotApproved, fmt.Errorf("no contract address found for asset %d contract version %d", w.assetID, assetVer) + } + return w.approvalStatus(contract, func() (*big.Int, error) { + return w.tokenAllowance(assetVer) + }) +} + // ApproveToken sends an approval transaction for a specific version of // the token's swap contract. An error is returned if an approval has // already been done or is pending. The onConfirm callback is called // when the approval transaction is confirmed. func (w *TokenWallet) ApproveToken(assetVer uint32, onConfirm func()) (string, error) { - approvalStatus, err := w.approvalStatus(assetVer) + contract, found := w.versionedContracts[assetVer] + if !found { + return "", fmt.Errorf("no contract address found for asset %d contract version %d", w.assetID, assetVer) + } + + approvalStatus, err := w.tokenSwapContractApprovalStatus(assetVer) if err != nil { return "", fmt.Errorf("error checking approval status: %w", err) } @@ -2618,8 +2662,8 @@ func (w *TokenWallet) ApproveToken(assetVer uint32, onConfirm func()) (string, e w.approvalsMtx.Lock() defer w.approvalsMtx.Unlock() - delete(w.approvalCache, assetVer) - w.pendingApprovals[assetVer] = &pendingApproval{ + delete(w.approvalCache, contract) + w.pendingApprovals[contract] = &pendingApproval{ txHash: tx.Hash(), onConfirm: onConfirm, } @@ -2630,7 +2674,12 @@ func (w *TokenWallet) ApproveToken(assetVer uint32, onConfirm func()) (string, e // UnapproveToken removes the approval for a specific version of the token's // swap contract. func (w *TokenWallet) UnapproveToken(assetVer uint32, onConfirm func()) (string, error) { - approvalStatus, err := w.approvalStatus(assetVer) + contract, found := w.versionedContracts[assetVer] + if !found { + return "", fmt.Errorf("no contract address found for asset %d contract version %d", w.assetID, assetVer) + } + + approvalStatus, err := w.tokenSwapContractApprovalStatus(assetVer) if err != nil { return "", fmt.Errorf("error checking approval status: %w", err) } @@ -2668,8 +2717,8 @@ func (w *TokenWallet) UnapproveToken(assetVer uint32, onConfirm func()) (string, w.approvalsMtx.Lock() defer w.approvalsMtx.Unlock() - delete(w.approvalCache, assetVer) - w.pendingApprovals[assetVer] = &pendingApproval{ + delete(w.approvalCache, contract) + w.pendingApprovals[contract] = &pendingApproval{ txHash: tx.Hash(), onConfirm: onConfirm, } @@ -2705,7 +2754,7 @@ func (w *TokenWallet) ApprovalStatus() map[uint32]asset.ApprovalStatus { statuses := map[uint32]asset.ApprovalStatus{} for _, version := range versions { - status, err := w.approvalStatus(version) + status, err := w.tokenSwapContractApprovalStatus(version) if err != nil { w.log.Errorf("error checking approval status for version %d: %w", version, err) continue @@ -2716,6 +2765,207 @@ func (w *TokenWallet) ApprovalStatus() map[uint32]asset.ApprovalStatus { return statuses } +// BridgeContractApprovalStatus returns whether the bridge contract has been +// approved to spend tokens on behalf of the account handled by the wallet. +func (w *BridgeWallet) BridgeContractApprovalStatus(ctx context.Context) (asset.ApprovalStatus, error) { + return w.approvalStatus(w.bridge.bridgeContractAddr(), func() (*big.Int, error) { + return w.bridge.bridgeContractAllowance(ctx, w.addr) + }) +} + +// ApproveBridgeContract approves the bridge contract to spend tokens on behalf +// of the account handled by the wallet. +func (w *BridgeWallet) ApproveBridgeContract(ctx context.Context) (string, error) { + approvalStatus, err := w.BridgeContractApprovalStatus(ctx) + if err != nil { + return "", fmt.Errorf("error checking approval status: %w", err) + } + if approvalStatus == asset.Approved { + return "", fmt.Errorf("bridge contract is already approved") + } + if approvalStatus == asset.Pending { + return "", fmt.Errorf("approval is already pending") + } + + maxFeeRate, tipRate, err := w.recommendedMaxFeeRate(ctx) + if err != nil { + return "", fmt.Errorf("error calculating approval fee rate: %w", err) + } + feeRateGwei := dexeth.WeiToGweiCeil(maxFeeRate) + approvalGas, err := w.approvalGas(unlimitedAllowance, contractVersionNewest) + if err != nil { + return "", fmt.Errorf("error calculating approval gas: %w", err) + } + + ethBal, err := w.balance() + if err != nil { + return "", fmt.Errorf("error getting eth balance: %w", err) + } + if ethBal.Available < approvalGas*feeRateGwei { + return "", fmt.Errorf("insufficient fee balance for approval. required: %d, available: %d", + approvalGas*feeRateGwei, ethBal.Available) + } + + var txID string + return txID, w.withNonce(ctx, func(nonce *big.Int) (*types.Transaction, asset.TransactionType, uint64, error) { + txOpts, err := w.node.txOpts(ctx, 0, approvalGas, maxFeeRate, tipRate, nonce) + if err != nil { + return nil, 0, 0, fmt.Errorf("txOpts error: %w", err) + } + + tx, err := w.bridge.approveBridgeContract(txOpts, unlimitedAllowance) + if err != nil { + return nil, 0, 0, fmt.Errorf("error approving bridge contract: %w", err) + } + + txID = tx.Hash().Hex() + + w.approvalsMtx.Lock() + delete(w.approvalCache, w.bridge.bridgeContractAddr()) + w.pendingApprovals[w.bridge.bridgeContractAddr()] = &pendingApproval{ + txHash: tx.Hash(), + onConfirm: func() {}, + } + w.approvalsMtx.Unlock() + + return tx, asset.ApproveToken, w.atomize(unlimitedAllowance), nil + }) +} + +// UnapproveBridgeContract removes the approval for the bridge contract. +func (w *BridgeWallet) UnapproveBridgeContract(ctx context.Context) (string, error) { + approvalStatus, err := w.BridgeContractApprovalStatus(ctx) + if err != nil { + return "", fmt.Errorf("error checking approval status: %w", err) + } + if approvalStatus == asset.NotApproved { + return "", fmt.Errorf("bridge contract is not approved") + } + if approvalStatus == asset.Pending { + return "", fmt.Errorf("approval update is pending") + } + + maxFeeRate, tipRate, err := w.recommendedMaxFeeRate(ctx) + if err != nil { + return "", fmt.Errorf("error calculating approval fee rate: %w", err) + } + feeRateGwei := dexeth.WeiToGweiCeil(maxFeeRate) + approvalGas, err := w.approvalGas(new(big.Int), contractVersionNewest) + if err != nil { + return "", fmt.Errorf("error calculating approval gas: %w", err) + } + + ethBal, err := w.balance() + if err != nil { + return "", fmt.Errorf("error getting eth balance: %w", err) + } + if ethBal.Available < approvalGas*feeRateGwei { + return "", fmt.Errorf("insufficient fee balance for approval. required: %d, available: %d", + approvalGas*feeRateGwei, ethBal.Available) + } + + var txID string + return txID, w.withNonce(ctx, func(nonce *big.Int) (*types.Transaction, asset.TransactionType, uint64, error) { + txOpts, err := w.node.txOpts(ctx, 0, approvalGas, maxFeeRate, tipRate, nonce) + if err != nil { + return nil, 0, 0, fmt.Errorf("txOpts error: %w", err) + } + + tx, err := w.bridge.approveBridgeContract(txOpts, new(big.Int)) + if err != nil { + return nil, 0, 0, fmt.Errorf("error approving bridge contract: %w", err) + } + + txID = tx.Hash().Hex() + + w.approvalsMtx.Lock() + delete(w.approvalCache, w.bridge.bridgeContractAddr()) + w.pendingApprovals[w.bridge.bridgeContractAddr()] = &pendingApproval{ + txHash: tx.Hash(), + onConfirm: func() {}, + } + w.approvalsMtx.Unlock() + + return tx, asset.ApproveToken, w.atomize(new(big.Int)), nil + }) +} + +// Bridge sends tokens to the bridge contract to be burned in order to be able +// to mint them on the destination chain. +func (w *BridgeWallet) Bridge(ctx context.Context, amt uint64, dest uint32) (txID string, err error) { + approvalStatus, err := w.BridgeContractApprovalStatus(ctx) + if err != nil { + return "", fmt.Errorf("error checking approval status: %w", err) + } + if approvalStatus == asset.NotApproved { + return "", fmt.Errorf("bridge contract is not approved") + } + if approvalStatus == asset.Pending { + return "", fmt.Errorf("bridge contract approval is still pending") + } + + maxFeeRate, tipRate, err := w.recommendedMaxFeeRate(ctx) + if err != nil { + return "", fmt.Errorf("error calculating bridge fee rate: %w", err) + } + + return txID, w.withNonce(ctx, func(nonce *big.Int) (*types.Transaction, asset.TransactionType, uint64, error) { + txOpts, err := w.node.txOpts(ctx, 0, burnForDepositGas, maxFeeRate, tipRate, nonce) + if err != nil { + return nil, 0, 0, fmt.Errorf("txOpts error: %w", err) + } + + tx, err := w.bridge.depositForBurn(txOpts, dest, w.addr, w.token.AtomicToEVM(amt)) + if err != nil { + return nil, 0, 0, err + } + + txID = tx.Hash().Hex() + return tx, asset.BridgeToken, amt, nil + }) +} + +// GetMintData takes the tx ID of the burn transaction and returns the data +// needed to mint the tokens on the destination chain. +func (w *BridgeWallet) GetMintData(ctx context.Context, burnTxID string) ([]byte, error) { + txHash := common.HexToHash(burnTxID) + + // TODO: this will be called multiple times while we are waiting for circle + // to do an attestation. The txReceipt can be cached to avoid unnecessary + // calls. + txReceipt, err := w.node.transactionReceipt(ctx, txHash) + if err != nil { + return nil, fmt.Errorf("error getting transaction receipt: %w", err) + } + + return w.bridge.getMintInfo(ctx, txReceipt) +} + +// Mint sends a transaction to mint tokens on the destination chain. +func (w *BridgeWallet) Mint(ctx context.Context, mintData []byte) (txID string, err error) { + maxFeeRate, tipRate, err := w.recommendedMaxFeeRate(ctx) + if err != nil { + return "", fmt.Errorf("error calculating bridge fee rate: %w", err) + } + + return txID, w.withNonce(ctx, func(nonce *big.Int) (*types.Transaction, asset.TransactionType, uint64, error) { + txOpts, err := w.node.txOpts(ctx, 0, messageReceivedGas, maxFeeRate, tipRate, nonce) + if err != nil { + return nil, 0, 0, fmt.Errorf("txOpts error: %w", err) + } + + tx, err := w.bridge.mintToken(txOpts, mintData) + if err != nil { + return nil, 0, 0, err + } + + txID = tx.Hash().Hex() + + // TODO: find amount of tokens minted, will be in logs + return tx, asset.MintToken, 0, nil + }) +} + // ReserveNRedemptions locks funds for redemption. It is an error if there // is insufficient spendable balance. Part of the AccountLocker interface. func (w *ETHWallet) ReserveNRedemptions(n uint64, ver uint32, maxFeeRate uint64) (uint64, error) { diff --git a/client/asset/eth/eth_test.go b/client/asset/eth/eth_test.go index 1f85c5c1c1..337426e4ab 100644 --- a/client/asset/eth/eth_test.go +++ b/client/asset/eth/eth_test.go @@ -982,6 +982,9 @@ func TestCheckForNewBlocks(t *testing.T) { txDB: &tTxDB{}, finalizeConfs: txConfsNeededToConfirm, }, + versionedContracts: map[uint32]common.Address{ + 0: {}, + }, log: tLogger.SubLogger("ETH"), emit: emit, assetID: BipID, @@ -1196,11 +1199,14 @@ func tassetWallet(assetID uint32) (asset.Wallet, *assetWallet, *tMempoolNode, co evmify: dexeth.GweiToWei, atomize: dexeth.WeiToGwei, pendingTxCheckBal: new(big.Int), - pendingApprovals: make(map[uint32]*pendingApproval), - approvalCache: make(map[uint32]bool), + pendingApprovals: make(map[common.Address]*pendingApproval), + approvalCache: make(map[common.Address]bool), // move up after review wi: WalletInfo, emit: asset.NewWalletEmitter(emitChan, BipID, tLogger), + versionedContracts: map[uint32]common.Address{ + 0: {}, + }, } aw.wallets = map[uint32]*assetWallet{ BipID: aw, @@ -1219,8 +1225,8 @@ func tassetWallet(assetID uint32) (asset.Wallet, *assetWallet, *tMempoolNode, co contractors: map[uint32]contractor{0: node.tContractor}, assetID: BipID, atomize: dexeth.WeiToGwei, - pendingApprovals: make(map[uint32]*pendingApproval), - approvalCache: make(map[uint32]bool), + pendingApprovals: make(map[common.Address]*pendingApproval), + approvalCache: make(map[common.Address]bool), emit: asset.NewWalletEmitter(emitChan, BipID, tLogger), } w = &TokenWallet{ @@ -1895,7 +1901,7 @@ func testFundOrderReturnCoinsFundingCoins(t *testing.T, assetID uint32) { // Test that funding without allowance causes error if assetID != BipID { - eth.approvalCache = make(map[uint32]bool) + eth.approvalCache = make(map[common.Address]bool) node.tokenContractor.allow = big.NewInt(0) _, _, _, err = w.FundOrder(&order) if err == nil { diff --git a/client/asset/eth/usdc_bridge.go b/client/asset/eth/usdc_bridge.go new file mode 100644 index 0000000000..9d58e5fe32 --- /dev/null +++ b/client/asset/eth/usdc_bridge.go @@ -0,0 +1,289 @@ +package eth + +import ( + "context" + "encoding/hex" + "encoding/json" + "fmt" + "io" + "math/big" + "net/http" + "strings" + + "decred.org/dcrdex/dex" + "decred.org/dcrdex/dex/encode" + "decred.org/dcrdex/dex/networks/erc20" + "decred.org/dcrdex/dex/networks/erc20/cctp" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/crypto" +) + +var ( + usdcEthID, _ = dex.BipSymbolID("usdc.eth") + usdcPolygonID, _ = dex.BipSymbolID("usdc.polygon") + + // burn for deposit generally requires 102k-103k gas + burnForDepositGas uint64 = 160_000 + // message received generally requires ~142k, but if this is the first + // time the user owns this asset, it will be ~160k + messageReceivedGas uint64 = 210_000 +) + +type usdcBridgeInfo struct { + tokenMessengerAddr common.Address + messageTransmitterAddr common.Address + domainID uint32 +} + +var usdcBridgeInfos = map[uint32]map[dex.Network]*usdcBridgeInfo{ + usdcEthID: { + dex.Mainnet: { + tokenMessengerAddr: common.HexToAddress("0xbd3fa81b58ba92a82136038b25adec7066af3155"), + messageTransmitterAddr: common.HexToAddress("0x0a992d191deec32afe36203ad87d7d289a738f81"), + domainID: 0, + }, + dex.Testnet: { + tokenMessengerAddr: common.HexToAddress("0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5"), + messageTransmitterAddr: common.HexToAddress("0x7865fAfC2db2093669d92c0F33AeEF291086BEFD"), + domainID: 0, + }, + }, + usdcPolygonID: { + dex.Mainnet: { + tokenMessengerAddr: common.HexToAddress("0x9daF8c91AEFAE50b9c0E69629D3F6Ca40cA3B3FE"), + messageTransmitterAddr: common.HexToAddress("0xF3be9355363857F3e001be68856A2f96b4C39Ba9"), + domainID: 7, + }, + dex.Testnet: { + tokenMessengerAddr: common.HexToAddress("0x9f3B8679c73C2Fef8b59B4f3444d4e156fb70AA5"), + messageTransmitterAddr: common.HexToAddress("0x7865fAfC2db2093669d92c0F33AeEF291086BEFD"), + domainID: 7, + }, + }, +} + +var usdcBridgeAttestationUrl = map[dex.Network]string{ + dex.Mainnet: "https://iris-api.circle.com/attestations/", + dex.Testnet: "https://iris-api-sandbox.circle.com/attestations/", +} + +func getUsdcBridgeInfo(assetID uint32, net dex.Network) *usdcBridgeInfo { + assetBridgeInfo, found := usdcBridgeInfos[assetID] + if !found { + return nil + } + + return assetBridgeInfo[net] +} + +// usdcBridge implements Circle's CCTP protocol to allow bridging native usdc +// between chains. +// +// https://developers.circle.com/stablecoins/docs/cctp-getting-started +// +// The bridge works using the following steps: +// +// 1. Call the "TokenMessenger" contract to burn the USDC on the source chain. +// The "TokenMessenger" contract must be approved to spend the USDC. The +// "depositForBurn" method will emit a "MessageSent" event. +// 2. After a certain number of confirmations, use the hash of the message in +// the emitted "MessageSent" event and retrieve an attestation from Circle's +// API. +// 3. Use the message and attestation to call the "receiveMessage" function on the +// target chain's "MessageTransmitter" contract to mint the USDC on the target +// chain. +type usdcBridge struct { + tokenMessenger *cctp.TokenMessenger + tokenMessengerAddr common.Address + messasgeTransmitter *cctp.MessageTransmitter + messageTransmitterAddr common.Address + tokenContract *erc20.IERC20 + tokenAddress common.Address + cb bind.ContractBackend + attestationUrl string + net dex.Network +} + +func newUsdcBrdge(assetID uint32, net dex.Network, tokenAddress common.Address, cb bind.ContractBackend) (*usdcBridge, error) { + bridgeInfo := getUsdcBridgeInfo(assetID, net) + if bridgeInfo == nil { + return nil, fmt.Errorf("usdc bridge info not found for assetID %d and network %s", assetID, net) + } + + attestationUrl, found := usdcBridgeAttestationUrl[net] + if !found { + return nil, fmt.Errorf("attestation url not found for network %s", net) + } + + messageTransmitter, err := cctp.NewMessageTransmitter(bridgeInfo.messageTransmitterAddr, cb) + if err != nil { + return nil, err + } + + tokenMessenger, err := cctp.NewTokenMessenger(bridgeInfo.tokenMessengerAddr, cb) + if err != nil { + return nil, err + } + + tokenContract, err := erc20.NewIERC20(tokenAddress, cb) + if err != nil { + return nil, err + } + + return &usdcBridge{ + tokenMessenger: tokenMessenger, + tokenMessengerAddr: bridgeInfo.tokenMessengerAddr, + messasgeTransmitter: messageTransmitter, + messageTransmitterAddr: bridgeInfo.messageTransmitterAddr, + tokenAddress: tokenAddress, + tokenContract: tokenContract, + cb: cb, + net: net, + attestationUrl: attestationUrl, + }, nil +} + +// bridgeContractAddr returns the address of the bridge contract. +func (b *usdcBridge) bridgeContractAddr() common.Address { + return b.tokenMessengerAddr +} + +// bridgeContractAllowance returns the amount that the bridge contract is +// allowed to spend on behalf of the user. +func (b *usdcBridge) bridgeContractAllowance(ctx context.Context, addr common.Address) (*big.Int, error) { + _, pendingUnavailable := b.cb.(*multiRPCClient) + callOpts := &bind.CallOpts{ + Pending: !pendingUnavailable, + From: addr, + Context: ctx, + } + return b.tokenContract.Allowance(callOpts, addr, b.tokenMessengerAddr) +} + +// approveBridgeContract approves the bridge contract to spend the given amount +// of the token on behalf of the user. +func (b *usdcBridge) approveBridgeContract(txOpts *bind.TransactOpts, amount *big.Int) (*types.Transaction, error) { + return b.tokenContract.Approve(txOpts, b.tokenMessengerAddr, amount) +} + +// depositForBurn burns the given amount of the token on the source chain to +// bridge it to the destination chain. +func (b *usdcBridge) depositForBurn(txOpts *bind.TransactOpts, destAssetID uint32, addr common.Address, amount *big.Int) (*types.Transaction, error) { + destBridgeInfo := getUsdcBridgeInfo(destAssetID, b.net) + if destBridgeInfo == nil { + return nil, fmt.Errorf("usdc bridge info not found for assetID %d and network %s", destAssetID, b.net) + } + + var recipient [32]byte + copy(recipient[12:], addr[:]) + + return b.tokenMessenger.DepositForBurn(txOpts, amount, destBridgeInfo.domainID, recipient, b.tokenAddress) +} + +// usdcMintInfo is the data required to mint the USDC on the destination chain. +type usdcMintInfo struct { + attestation []byte + message []byte +} + +func (u *usdcMintInfo) serialize() []byte { + return encode.BuildyBytes{0}. + AddData(u.attestation). + AddData(u.message) +} + +func deserializeUsdcMintInfo(b []byte) (*usdcMintInfo, error) { + ver, pushes, err := encode.DecodeBlob(b) + if err != nil { + return nil, err + } + + if ver != 0 { + return nil, fmt.Errorf("invalid version %d", ver) + } + + if len(pushes) != 2 { + return nil, fmt.Errorf("expected 2 pushes, got %d", len(pushes)) + } + + return &usdcMintInfo{ + attestation: pushes[0], + message: pushes[1], + }, nil +} + +// getMintInfo retrieves the message from the receipt of the depositForBurn +// call, and then retrieves the attestation from Circle's API. It returns the +// serialized data required to mint the USDC on the destination chain. +func (b *usdcBridge) getMintInfo(ctx context.Context, receipt *types.Receipt) ([]byte, error) { + var msg []byte + for _, log := range receipt.Logs { + messageSent, err := b.messasgeTransmitter.ParseMessageSent(*log) + if err != nil { + continue + } + msg = messageSent.Message + break + } + if msg == nil { + return nil, fmt.Errorf("no message sent event found in the receipt") + } + + msgHash := "0x" + hex.EncodeToString(crypto.Keccak256(msg)) + url := fmt.Sprintf("%s%s", b.attestationUrl, msgHash) + req, err := http.NewRequestWithContext(ctx, "GET", url, nil) + if err != nil { + return nil, err + } + + resp, err := http.DefaultClient.Do(req) + if err != nil { + return nil, err + } + defer resp.Body.Close() + + if resp.StatusCode != http.StatusOK { + return nil, fmt.Errorf("attestation request failed with status %d", resp.StatusCode) + } + + reader := io.LimitReader(resp.Body, 1<<22) + r, err := io.ReadAll(reader) + if err != nil { + return nil, err + } + attestationResponse := struct { + Attestation string `json:"attestation"` + Status string `json:"status"` + }{} + err = json.Unmarshal(r, &attestationResponse) + if err != nil { + return nil, err + } + + if attestationResponse.Status != "complete" { + return nil, fmt.Errorf("attestation is still pending") + } + + attestation := strings.TrimPrefix(attestationResponse.Attestation, "0x") + attestationBytes, err := hex.DecodeString(attestation) + if err != nil { + return nil, err + } + + return (&usdcMintInfo{ + attestation: attestationBytes, + message: msg, + }).serialize(), nil +} + +// mintToken mints the USDC on the destination chain using the mint info. +func (b *usdcBridge) mintToken(txOpts *bind.TransactOpts, mintInfoB []byte) (*types.Transaction, error) { + mintInfo, err := deserializeUsdcMintInfo(mintInfoB) + if err != nil { + return nil, err + } + + return b.messasgeTransmitter.ReceiveMessage(txOpts, mintInfo.message, mintInfo.attestation) +} diff --git a/client/asset/interface.go b/client/asset/interface.go index f6d7b9b5d2..53cb7ca2d0 100644 --- a/client/asset/interface.go +++ b/client/asset/interface.go @@ -671,6 +671,15 @@ type Withdrawer interface { Withdraw(address string, value, feeRate uint64) (Coin, error) } +type Bridger interface { + ApproveBridgeContract(ctx context.Context) (string, error) + UnapproveBridgeContract(ctx context.Context) (string, error) + BridgeContractApprovalStatus(ctx context.Context) (ApprovalStatus, error) + Bridge(ctx context.Context, amt uint64, dest uint32) (txID string, err error) + GetMintData(ctx context.Context, txID string) ([]byte, error) + Mint(ctx context.Context, mintData []byte) (txID string, err error) +} + // Sweeper is a wallet that can clear the entire balance of the wallet/account // to an address. Similar to Withdraw, but no input value is required. type Sweeper interface { @@ -1110,6 +1119,8 @@ const ( // SwapOrSend is used when a wallet scanned its historical transactions, // and was unable to determine if the transaction was a swap or a send. SwapOrSend + BridgeToken + MintToken ) // IncomingTxType returns true if the wallet's balance increases due to a diff --git a/client/core/core.go b/client/core/core.go index 064679ef08..a06512fe0a 100644 --- a/client/core/core.go +++ b/client/core/core.go @@ -5944,6 +5944,116 @@ func (c *Core) ApproveTokenFee(assetID uint32, version uint32, approval bool) (u return wallet.ApprovalFee(version, approval) } +// BridgeContractApprovalStatus returns the approval status of the bridge +// contract for the specified asset. +func (c *Core) BridgeContractApprovalStatus(assetID uint32) (asset.ApprovalStatus, error) { + wallet, err := c.connectedWallet(assetID) + if err != nil { + return 0, err + } + + return wallet.BridgeContractApprovalStatus(c.ctx) +} + +// ApproveBridgeContract approves the bridge contract for the specified asset. +func (c *Core) ApproveBridgeContract(assetID uint32) (string, error) { + wallet, err := c.connectedWallet(assetID) + if err != nil { + return "", err + } + + if !wallet.unlocked() { + return "", fmt.Errorf("wallet %s must be unlocked", unbip(assetID)) + } + + err = wallet.checkPeersAndSyncStatus() + if err != nil { + return "", err + } + + txID, err := wallet.ApproveBridgeContract(c.ctx) + if err != nil { + return "", err + } + + return txID, nil +} + +// UnapproveBridgeContract unapproves the bridge contract for the specified +// asset. +func (c *Core) UnapproveBridgeContract(assetID uint32) (string, error) { + wallet, err := c.connectedWallet(assetID) + if err != nil { + return "", err + } + + if !wallet.unlocked() { + return "", fmt.Errorf("wallet %s must be unlocked", unbip(assetID)) + } + + err = wallet.checkPeersAndSyncStatus() + if err != nil { + return "", err + } + + txID, err := wallet.UnapproveBridgeContract(c.ctx) + if err != nil { + return "", err + } + + return txID, nil +} + +// Bridge burns tokens on the source chain in order to mint them on the +// destination chain. +func (c *Core) Bridge(fromAssetID, toAssetID uint32, amt uint64) (txID string, err error) { + wallet, err := c.connectedWallet(fromAssetID) + if err != nil { + return "", err + } + + if !wallet.unlocked() { + return "", fmt.Errorf("wallet %s must be unlocked", unbip(fromAssetID)) + } + + err = wallet.checkPeersAndSyncStatus() + if err != nil { + return "", err + } + + return wallet.Bridge(c.ctx, amt, toAssetID) +} + +// GetMintData takes the txID returned from bridge and looks up the data needed +// to mint the bridged tokens on the destination chain. +func (c *Core) GetMintData(fromAssetID uint32, burnTxID string) ([]byte, error) { + wallet, err := c.connectedWallet(fromAssetID) + if err != nil { + return nil, err + } + + return wallet.GetMintData(c.ctx, burnTxID) +} + +// Mint mints bridged tokens on the destination chain. +func (c *Core) Mint(toAssetID uint32, mintData []byte) (txID string, err error) { + wallet, err := c.connectedWallet(toAssetID) + if err != nil { + return "", err + } + + if !wallet.unlocked() { + return "", fmt.Errorf("wallet %s must be unlocked", unbip(toAssetID)) + } + + err = wallet.checkPeersAndSyncStatus() + if err != nil { + return "", err + } + + return wallet.Mint(c.ctx, mintData) +} + // EstimateSendTxFee returns an estimate of the tx fee needed to send or // withdraw the specified amount. func (c *Core) EstimateSendTxFee(address string, assetID uint32, amount uint64, subtract, maxWithdraw bool) (fee uint64, isValidAddress bool, err error) { diff --git a/client/core/wallet.go b/client/core/wallet.go index 5174dcd49f..c90b3ac199 100644 --- a/client/core/wallet.go +++ b/client/core/wallet.go @@ -655,6 +655,64 @@ func (w *xcWallet) ApprovalStatus() map[uint32]asset.ApprovalStatus { return approver.ApprovalStatus() } +// BridgeContractApprovalStatus returns the approval status of the bridge +// contract if the wallet is a Bridger. +func (w *xcWallet) BridgeContractApprovalStatus(ctx context.Context) (asset.ApprovalStatus, error) { + approver, ok := w.Wallet.(asset.Bridger) + if !ok { + return 0, fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return approver.BridgeContractApprovalStatus(ctx) +} + +// ApproveBridgeContract approves the bridge contract if the wallet is a +// Bridger. +func (w *xcWallet) ApproveBridgeContract(ctx context.Context) (string, error) { + approver, ok := w.Wallet.(asset.Bridger) + if !ok { + return "", fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return approver.ApproveBridgeContract(ctx) +} + +// UnapproveBridgeContract removes approval of the bridge contract if the +// wallet is a Bridger. +func (w *xcWallet) UnapproveBridgeContract(ctx context.Context) (string, error) { + approver, ok := w.Wallet.(asset.Bridger) + if !ok { + return "", fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return approver.UnapproveBridgeContract(ctx) +} + +// Bridge sends an amount to the specified destination if the wallet is a +// Bridger. +func (w *xcWallet) Bridge(ctx context.Context, amt uint64, dest uint32) (txID string, err error) { + bridger, ok := w.Wallet.(asset.Bridger) + if !ok { + return "", fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return bridger.Bridge(ctx, amt, dest) +} + +// GetMintData retrieves the mint data for the specified transaction if the +func (w *xcWallet) GetMintData(ctx context.Context, txID string) ([]byte, error) { + bridger, ok := w.Wallet.(asset.Bridger) + if !ok { + return nil, fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return bridger.GetMintData(ctx, txID) +} + +// Mint mints the asset on the destination chain if the wallet is a Bridger. +func (w *xcWallet) Mint(ctx context.Context, mintData []byte) (txID string, err error) { + bridger, ok := w.Wallet.(asset.Bridger) + if !ok { + return "", fmt.Errorf("%s wallet is not a Bridger", unbip(w.AssetID)) + } + return bridger.Mint(ctx, mintData) +} + // feeRater is identical to calling w.Wallet.(asset.FeeRater). func (w *xcWallet) feeRater() (asset.FeeRater, bool) { rater, is := w.Wallet.(asset.FeeRater) diff --git a/client/rpcserver/handlers.go b/client/rpcserver/handlers.go index 827d3a2a40..8610c2fbb3 100644 --- a/client/rpcserver/handlers.go +++ b/client/rpcserver/handlers.go @@ -4,10 +4,12 @@ package rpcserver import ( + "encoding/hex" "encoding/json" "fmt" "os" "sort" + "strconv" "strings" "time" @@ -64,6 +66,7 @@ const ( setVotingPreferencesRoute = "setvotingprefs" txHistoryRoute = "txhistory" walletTxRoute = "wallettx" + bridgeRoute = "bridge" ) const ( @@ -141,6 +144,7 @@ var routes = map[string]func(s *RPCServer, params *RawParams) *msgjson.ResponseP setVotingPreferencesRoute: handleSetVotingPreferences, txHistoryRoute: handleTxHistory, walletTxRoute: handleWalletTx, + bridgeRoute: handleBridge, } // handleHelp handles requests for help. Returns general help for all commands @@ -1176,6 +1180,162 @@ func handleWalletTx(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { return createResponse(walletTxRoute, tx, nil) } +func handleCheckBridgeApproval(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) != 1 { + return usage(bridgeRoute, fmt.Errorf("expected 1 args, got %d", len(params.Args))) + } + + i, err := strconv.ParseUint(params.Args[0], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing assetID: %v", err)) + } + + assetID := uint32(i) + + approvalStatus, err := s.core.BridgeContractApprovalStatus(assetID) + if err != nil { + errMsg := fmt.Sprintf("unable to check bridge approval: %v", err) + resErr := msgjson.NewError(msgjson.RPCBridgeError, errMsg) + return createResponse(bridgeRoute, nil, resErr) + } + + return createResponse(bridgeRoute, approvalStatus, nil) +} + +func handleApproveBridge(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) != 2 { + return usage(bridgeRoute, fmt.Errorf("expected 2 args, got %d", len(params.Args))) + } + + i, err := strconv.ParseUint(params.Args[0], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing assetID: %v", err)) + } + + assetID := uint32(i) + + approve, err := strconv.ParseBool(params.Args[1]) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing approve: %v", err)) + } + + var txID string + if approve { + txID, err = s.core.ApproveBridgeContract(assetID) + } else { + txID, err = s.core.UnapproveBridgeContract(assetID) + } + + if err != nil { + errMsg := fmt.Sprintf("unable to approve bridge contract: %v", err) + resErr := msgjson.NewError(msgjson.RPCBridgeError, errMsg) + return createResponse(bridgeRoute, nil, resErr) + } + + return createResponse(bridgeRoute, txID, nil) +} + +func handleBurn(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) != 3 { + return usage(bridgeRoute, fmt.Errorf("expected 3 args, got %d", len(params.Args))) + } + + fromAssetID, err := strconv.ParseUint(params.Args[0], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing fromAssetID: %v", err)) + } + + toAssetID, err := strconv.ParseUint(params.Args[1], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing toAssetID: %v", err)) + } + + value, err := strconv.ParseUint(params.Args[2], 10, 64) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing value: %v", err)) + } + + txID, err := s.core.Bridge(uint32(fromAssetID), uint32(toAssetID), value) + if err != nil { + errMsg := fmt.Sprintf("unable to burn tokens: %v", err) + resErr := msgjson.NewError(msgjson.RPCBridgeError, errMsg) + return createResponse(bridgeRoute, nil, resErr) + } + + return createResponse(bridgeRoute, txID, nil) +} + +func handleGetMintData(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) != 2 { + return usage(bridgeRoute, fmt.Errorf("expected 1 args, got %d", len(params.Args))) + } + + fromAssetID, err := strconv.ParseUint(params.Args[0], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing fromAssetID: %v", err)) + } + + burnTxID := params.Args[1] + + mintInfo, err := s.core.GetMintData(uint32(fromAssetID), burnTxID) + if err != nil { + errMsg := fmt.Sprintf("unable to get mint info: %v", err) + resErr := msgjson.NewError(msgjson.RPCBridgeError, errMsg) + return createResponse(bridgeRoute, nil, resErr) + } + + return createResponse(bridgeRoute, hex.EncodeToString(mintInfo), nil) +} + +func handleMint(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) != 2 { + return usage(bridgeRoute, fmt.Errorf("expected 1 args, got %d", len(params.Args))) + } + + toAssetID, err := strconv.ParseUint(params.Args[0], 10, 32) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing toAssetID: %v", err)) + } + + mintData, err := hex.DecodeString(params.Args[1]) + if err != nil { + return usage(bridgeRoute, fmt.Errorf("error parsing mintData: %v", err)) + } + + mintInfo, err := s.core.Mint(uint32(toAssetID), mintData) + if err != nil { + errMsg := fmt.Sprintf("unable to get mint info: %v", err) + resErr := msgjson.NewError(msgjson.RPCBridgeError, errMsg) + return createResponse(bridgeRoute, nil, resErr) + } + + return createResponse(bridgeRoute, mintInfo, nil) +} + +func handleBridge(s *RPCServer, params *RawParams) *msgjson.ResponsePayload { + if len(params.Args) < 1 { + return usage(bridgeRoute, fmt.Errorf("no arguments provided")) + } + + subCommand := params.Args[0] + params.Args = params.Args[1:] + + switch subCommand { + case "checkbridgeapproval": + return handleCheckBridgeApproval(s, params) + case "approvebridge": + return handleApproveBridge(s, params) + case "burn": + return handleBurn(s, params) + case "getmintinfo": + return handleGetMintData(s, params) + case "mint": + return handleMint(s, params) + } + + return usage(bridgeRoute, fmt.Errorf("unrecognized subcommand %s", subCommand)) +} + // format concatenates thing and tail. If thing is empty, returns an empty // string. func format(thing, tail string) string { @@ -1957,4 +2117,29 @@ an spv wallet and enables options to view and set the vsp. assetID (int): The asset's BIP-44 registered coin index. txID (string): The transaction ID.`, }, + bridgeRoute: { + argsShort: `subCommand subCommandArgs...`, + cmdSummary: `Interact with a token bridge. + Subcommands are "checkbridgeapproval", "approvebridge", "burn", "getmintinfo", "mint". + checkbridgeapproval: Check if the bridge contract is approved. + args: assetID + approvebridge: (Un)Approve the bridge contract. + args: assetID approve + burn: Burn tokens on "from" chain. + args: fromAssetID toAssetID value + getmintinfo: Get information needed to mint tokens. + args: burnTxID + mint: Mint tokens on "to" chain. + args: mintInfo + `, + argsLong: `Args: + subCommand (string): The subcommand to execute. + assetID (int): The asset's BIP-44 registered coin index. + approve (bool): Whether to approve or unapprove the bridge contract. + fromAssetID (int): The asset's BIP-44 registered coin index on the "from" chain. + toAssetID (int): The asset's BIP-44 registered coin index on the "to" chain. + value (int): The amount of tokens to bridge. + burnTxID (string): The transaction ID of the burn transaction. Returned from the burn command. + mintInfo (string): The information needed to mint tokens. Returned from the getmintinfo command.`, + }, } diff --git a/client/rpcserver/rpcserver.go b/client/rpcserver/rpcserver.go index 3fa839a229..d6e7bd325d 100644 --- a/client/rpcserver/rpcserver.go +++ b/client/rpcserver/rpcserver.go @@ -87,6 +87,12 @@ type clientCore interface { MultiTrade(pw []byte, form *core.MultiTradeForm) ([]*core.Order, error) TxHistory(assetID uint32, n int, refID *string, past bool) ([]*asset.WalletTransaction, error) WalletTransaction(assetID uint32, txID string) (*asset.WalletTransaction, error) + BridgeContractApprovalStatus(assetID uint32) (asset.ApprovalStatus, error) + ApproveBridgeContract(assetID uint32) (string, error) + UnapproveBridgeContract(assetID uint32) (string, error) + Bridge(fromAssetID, toAssetID uint32, amt uint64) (txID string, err error) + GetMintData(fromAssetID uint32, txID string) ([]byte, error) + Mint(toAssetID uint32, mintData []byte) (txID string, err error) // These are core's ticket buying interface. StakeStatus(assetID uint32) (*asset.TicketStakingStatus, error) diff --git a/client/rpcserver/rpcserver_test.go b/client/rpcserver/rpcserver_test.go index 8f98f97db4..510dd7dc09 100644 --- a/client/rpcserver/rpcserver_test.go +++ b/client/rpcserver/rpcserver_test.go @@ -203,6 +203,24 @@ func (c *TCore) TxHistory(assetID uint32, n int, refID *string, past bool) ([]*a func (c *TCore) WalletTransaction(assetID uint32, txID string) (*asset.WalletTransaction, error) { return nil, nil } +func (c *TCore) BridgeContractApprovalStatus(assetID uint32) (asset.ApprovalStatus, error) { + return 0, nil +} +func (c *TCore) ApproveBridgeContract(assetID uint32) (string, error) { + return "", nil +} +func (c *TCore) UnapproveBridgeContract(assetID uint32) (string, error) { + return "", nil +} +func (c *TCore) Bridge(fromAssetID, toAssetID uint32, amt uint64) (txID string, err error) { + return "", nil +} +func (c *TCore) GetMintData(fromAssetID uint32, txID string) ([]byte, error) { + return nil, nil +} +func (c *TCore) Mint(toAssetID uint32, mintData []byte) (txID string, err error) { + return "", nil +} type tBookFeed struct{} diff --git a/client/webserver/jsintl.go b/client/webserver/jsintl.go index 245b4c9d9c..3da34871c7 100644 --- a/client/webserver/jsintl.go +++ b/client/webserver/jsintl.go @@ -177,6 +177,8 @@ const ( txTypeTicketVoteID = "TX_TYPE_TICKET_VOTE" txTypeTicketRevokeID = "TX_TYPE_TICKET_REVOCATION" txTypeSwapOrSendID = "TX_TYPE_SWAP_OR_SEND" + txTypeBridgeBurnID = "TX_TYPE_BRIDGE_BURN" + txTypeBridgeMintID = "TX_TYPE_BRIDGE_MINT" swapOrSendTooltipID = "SWAP_OR_SEND_TOOLTIP" missingCexCredsID = "MISSING_CEX_CREDS" matchBufferID = "MATCH_BUFFER" @@ -369,6 +371,8 @@ var enUS = map[string]*intl.Translation{ txTypeTicketVoteID: {T: "Ticket vote"}, txTypeTicketRevokeID: {T: "Ticket revocation"}, txTypeSwapOrSendID: {T: "Swap / Send"}, + txTypeBridgeBurnID: {T: "Bridge burn"}, + txTypeBridgeMintID: {T: "Bridge mint"}, swapOrSendTooltipID: {T: "The wallet was unable to determine if this transaction was a swap or a send."}, missingCexCredsID: {T: "specify both key and secret"}, matchBufferID: {T: "Match buffer"}, diff --git a/client/webserver/site/src/js/locales.ts b/client/webserver/site/src/js/locales.ts index 4aefd9b287..4c4ad1d615 100644 --- a/client/webserver/site/src/js/locales.ts +++ b/client/webserver/site/src/js/locales.ts @@ -178,6 +178,8 @@ export const ID_TX_TYPE_TICKET_PURCHASE = 'TX_TYPE_TICKET_PURCHASE' export const ID_TX_TYPE_TICKET_VOTE = 'TX_TYPE_TICKET_VOTE' export const ID_TX_TYPE_TICKET_REVOCATION = 'TX_TYPE_TICKET_REVOCATION' export const ID_TX_TYPE_SWAP_OR_SEND = 'TX_TYPE_SWAP_OR_SEND' +export const ID_TX_TYPE_BRIDGE_BURN = 'TX_TYPE_BRIDGE_BURN' +export const ID_TX_TYPE_BRIDGE_MINT = 'TX_TYPE_BRIDGE_MINT' export const ID_SWAP_OR_SEND_TOOLTIP = 'SWAP_OR_SEND_TOOLTIP' export const ID_MISSING_CEX_CREDS = 'MISSING_CEX_CREDS' export const ID_MATCH_BUFFER = 'MATCH_BUFFER' diff --git a/client/webserver/site/src/js/wallets.ts b/client/webserver/site/src/js/wallets.ts index 64f035ebc8..62a43b0ae8 100644 --- a/client/webserver/site/src/js/wallets.ts +++ b/client/webserver/site/src/js/wallets.ts @@ -113,6 +113,8 @@ export const txTypeTicketPurchase = 13 export const txTypeTicketVote = 14 export const txTypeTicketRevocation = 15 export const txTypeSwapOrSend = 16 +export const txTypeBridgeBurn = 17 +export const txTypeBridgeMint = 18 const positiveTxTypes : number[] = [ txTypeReceive, @@ -120,7 +122,8 @@ const positiveTxTypes : number[] = [ txTypeRefund, txTypeRedeemBond, txTypeTicketVote, - txTypeTicketRevocation + txTypeTicketRevocation, + txTypeBridgeMint ] const negativeTxTypes : number[] = [ @@ -128,7 +131,8 @@ const negativeTxTypes : number[] = [ txTypeSwap, txTypeCreateBond, txTypeTicketPurchase, - txTypeSwapOrSend + txTypeSwapOrSend, + txTypeBridgeBurn ] const noAmtTxTypes : number[] = [ @@ -161,7 +165,9 @@ const txTypeTranslationKeys = [ intl.ID_TX_TYPE_TICKET_PURCHASE, intl.ID_TX_TYPE_TICKET_VOTE, intl.ID_TX_TYPE_TICKET_REVOCATION, - intl.ID_TX_TYPE_SWAP_OR_SEND + intl.ID_TX_TYPE_SWAP_OR_SEND, + intl.ID_TX_TYPE_BRIDGE_BURN, + intl.ID_TX_TYPE_BRIDGE_MINT ] export function txTypeString (txType: number) : string { diff --git a/dex/msgjson/types.go b/dex/msgjson/types.go index 7a66eaf2ce..456d5a19db 100644 --- a/dex/msgjson/types.go +++ b/dex/msgjson/types.go @@ -99,6 +99,7 @@ const ( RPCUpdateRunningBotCfgError // 80 RPCUpdateRunningBotInvError // 81 RPCMMStatusError // 82 + RPCBridgeError // 83 ) // Routes are destinations for a "payload" of data. The type of data being diff --git a/dex/networks/erc20/cctp/MessageTransmitter.go b/dex/networks/erc20/cctp/MessageTransmitter.go new file mode 100644 index 0000000000..3fec235dfc --- /dev/null +++ b/dex/networks/erc20/cctp/MessageTransmitter.go @@ -0,0 +1,2844 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package cctp + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// MessageTransmitterMetaData contains all meta data concerning the MessageTransmitter contract. +var MessageTransmitterMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_localDomain\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"_attester\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_maxMessageBodySize\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_version\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"}],\"name\":\"AttesterDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"}],\"name\":\"AttesterEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousAttesterManager\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAttesterManager\",\"type\":\"address\"}],\"name\":\"AttesterManagerUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newMaxMessageBodySize\",\"type\":\"uint256\"}],\"name\":\"MaxMessageBodySizeUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"caller\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"sourceDomain\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"MessageReceived\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"MessageSent\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Pause\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"PauserChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newRescuer\",\"type\":\"address\"}],\"name\":\"RescuerChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldSignatureThreshold\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newSignatureThreshold\",\"type\":\"uint256\"}],\"name\":\"SignatureThresholdUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"Unpause\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"attesterManager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"}],\"name\":\"disableAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAttester\",\"type\":\"address\"}],\"name\":\"enableAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"index\",\"type\":\"uint256\"}],\"name\":\"getEnabledAttester\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getNumEnabledAttesters\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"}],\"name\":\"isEnabledAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"localDomain\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"maxMessageBodySize\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"nextAvailableNonce\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pauser\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"attestation\",\"type\":\"bytes\"}],\"name\":\"receiveMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"success\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"originalMessage\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"originalAttestation\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"newMessageBody\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"newDestinationCaller\",\"type\":\"bytes32\"}],\"name\":\"replaceMessage\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"tokenContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"rescueERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rescuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"sendMessage\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"recipient\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"sendMessageWithCaller\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newMaxMessageBodySize\",\"type\":\"uint256\"}],\"name\":\"setMaxMessageBodySize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"newSignatureThreshold\",\"type\":\"uint256\"}],\"name\":\"setSignatureThreshold\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"signatureThreshold\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAttesterManager\",\"type\":\"address\"}],\"name\":\"updateAttesterManager\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_newPauser\",\"type\":\"address\"}],\"name\":\"updatePauser\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRescuer\",\"type\":\"address\"}],\"name\":\"updateRescuer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"name\":\"usedNonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"version\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", +} + +// MessageTransmitterABI is the input ABI used to generate the binding from. +// Deprecated: Use MessageTransmitterMetaData.ABI instead. +var MessageTransmitterABI = MessageTransmitterMetaData.ABI + +// MessageTransmitter is an auto generated Go binding around an Ethereum contract. +type MessageTransmitter struct { + MessageTransmitterCaller // Read-only binding to the contract + MessageTransmitterTransactor // Write-only binding to the contract + MessageTransmitterFilterer // Log filterer for contract events +} + +// MessageTransmitterCaller is an auto generated read-only Go binding around an Ethereum contract. +type MessageTransmitterCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MessageTransmitterTransactor is an auto generated write-only Go binding around an Ethereum contract. +type MessageTransmitterTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MessageTransmitterFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type MessageTransmitterFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// MessageTransmitterSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type MessageTransmitterSession struct { + Contract *MessageTransmitter // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MessageTransmitterCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type MessageTransmitterCallerSession struct { + Contract *MessageTransmitterCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// MessageTransmitterTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type MessageTransmitterTransactorSession struct { + Contract *MessageTransmitterTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// MessageTransmitterRaw is an auto generated low-level Go binding around an Ethereum contract. +type MessageTransmitterRaw struct { + Contract *MessageTransmitter // Generic contract binding to access the raw methods on +} + +// MessageTransmitterCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type MessageTransmitterCallerRaw struct { + Contract *MessageTransmitterCaller // Generic read-only contract binding to access the raw methods on +} + +// MessageTransmitterTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type MessageTransmitterTransactorRaw struct { + Contract *MessageTransmitterTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewMessageTransmitter creates a new instance of MessageTransmitter, bound to a specific deployed contract. +func NewMessageTransmitter(address common.Address, backend bind.ContractBackend) (*MessageTransmitter, error) { + contract, err := bindMessageTransmitter(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &MessageTransmitter{MessageTransmitterCaller: MessageTransmitterCaller{contract: contract}, MessageTransmitterTransactor: MessageTransmitterTransactor{contract: contract}, MessageTransmitterFilterer: MessageTransmitterFilterer{contract: contract}}, nil +} + +// NewMessageTransmitterCaller creates a new read-only instance of MessageTransmitter, bound to a specific deployed contract. +func NewMessageTransmitterCaller(address common.Address, caller bind.ContractCaller) (*MessageTransmitterCaller, error) { + contract, err := bindMessageTransmitter(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &MessageTransmitterCaller{contract: contract}, nil +} + +// NewMessageTransmitterTransactor creates a new write-only instance of MessageTransmitter, bound to a specific deployed contract. +func NewMessageTransmitterTransactor(address common.Address, transactor bind.ContractTransactor) (*MessageTransmitterTransactor, error) { + contract, err := bindMessageTransmitter(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &MessageTransmitterTransactor{contract: contract}, nil +} + +// NewMessageTransmitterFilterer creates a new log filterer instance of MessageTransmitter, bound to a specific deployed contract. +func NewMessageTransmitterFilterer(address common.Address, filterer bind.ContractFilterer) (*MessageTransmitterFilterer, error) { + contract, err := bindMessageTransmitter(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &MessageTransmitterFilterer{contract: contract}, nil +} + +// bindMessageTransmitter binds a generic wrapper to an already deployed contract. +func bindMessageTransmitter(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := MessageTransmitterMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MessageTransmitter *MessageTransmitterRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MessageTransmitter.Contract.MessageTransmitterCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MessageTransmitter *MessageTransmitterRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageTransmitter.Contract.MessageTransmitterTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MessageTransmitter *MessageTransmitterRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MessageTransmitter.Contract.MessageTransmitterTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_MessageTransmitter *MessageTransmitterCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _MessageTransmitter.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_MessageTransmitter *MessageTransmitterTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageTransmitter.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_MessageTransmitter *MessageTransmitterTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _MessageTransmitter.Contract.contract.Transact(opts, method, params...) +} + +// AttesterManager is a free data retrieval call binding the contract method 0x9b0d94b7. +// +// Solidity: function attesterManager() view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) AttesterManager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "attesterManager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// AttesterManager is a free data retrieval call binding the contract method 0x9b0d94b7. +// +// Solidity: function attesterManager() view returns(address) +func (_MessageTransmitter *MessageTransmitterSession) AttesterManager() (common.Address, error) { + return _MessageTransmitter.Contract.AttesterManager(&_MessageTransmitter.CallOpts) +} + +// AttesterManager is a free data retrieval call binding the contract method 0x9b0d94b7. +// +// Solidity: function attesterManager() view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) AttesterManager() (common.Address, error) { + return _MessageTransmitter.Contract.AttesterManager(&_MessageTransmitter.CallOpts) +} + +// GetEnabledAttester is a free data retrieval call binding the contract method 0xbeb673d8. +// +// Solidity: function getEnabledAttester(uint256 index) view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) GetEnabledAttester(opts *bind.CallOpts, index *big.Int) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "getEnabledAttester", index) + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetEnabledAttester is a free data retrieval call binding the contract method 0xbeb673d8. +// +// Solidity: function getEnabledAttester(uint256 index) view returns(address) +func (_MessageTransmitter *MessageTransmitterSession) GetEnabledAttester(index *big.Int) (common.Address, error) { + return _MessageTransmitter.Contract.GetEnabledAttester(&_MessageTransmitter.CallOpts, index) +} + +// GetEnabledAttester is a free data retrieval call binding the contract method 0xbeb673d8. +// +// Solidity: function getEnabledAttester(uint256 index) view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) GetEnabledAttester(index *big.Int) (common.Address, error) { + return _MessageTransmitter.Contract.GetEnabledAttester(&_MessageTransmitter.CallOpts, index) +} + +// GetNumEnabledAttesters is a free data retrieval call binding the contract method 0x51079a53. +// +// Solidity: function getNumEnabledAttesters() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCaller) GetNumEnabledAttesters(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "getNumEnabledAttesters") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// GetNumEnabledAttesters is a free data retrieval call binding the contract method 0x51079a53. +// +// Solidity: function getNumEnabledAttesters() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterSession) GetNumEnabledAttesters() (*big.Int, error) { + return _MessageTransmitter.Contract.GetNumEnabledAttesters(&_MessageTransmitter.CallOpts) +} + +// GetNumEnabledAttesters is a free data retrieval call binding the contract method 0x51079a53. +// +// Solidity: function getNumEnabledAttesters() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCallerSession) GetNumEnabledAttesters() (*big.Int, error) { + return _MessageTransmitter.Contract.GetNumEnabledAttesters(&_MessageTransmitter.CallOpts) +} + +// IsEnabledAttester is a free data retrieval call binding the contract method 0x7af82f60. +// +// Solidity: function isEnabledAttester(address attester) view returns(bool) +func (_MessageTransmitter *MessageTransmitterCaller) IsEnabledAttester(opts *bind.CallOpts, attester common.Address) (bool, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "isEnabledAttester", attester) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsEnabledAttester is a free data retrieval call binding the contract method 0x7af82f60. +// +// Solidity: function isEnabledAttester(address attester) view returns(bool) +func (_MessageTransmitter *MessageTransmitterSession) IsEnabledAttester(attester common.Address) (bool, error) { + return _MessageTransmitter.Contract.IsEnabledAttester(&_MessageTransmitter.CallOpts, attester) +} + +// IsEnabledAttester is a free data retrieval call binding the contract method 0x7af82f60. +// +// Solidity: function isEnabledAttester(address attester) view returns(bool) +func (_MessageTransmitter *MessageTransmitterCallerSession) IsEnabledAttester(attester common.Address) (bool, error) { + return _MessageTransmitter.Contract.IsEnabledAttester(&_MessageTransmitter.CallOpts, attester) +} + +// LocalDomain is a free data retrieval call binding the contract method 0x8d3638f4. +// +// Solidity: function localDomain() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterCaller) LocalDomain(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "localDomain") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// LocalDomain is a free data retrieval call binding the contract method 0x8d3638f4. +// +// Solidity: function localDomain() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterSession) LocalDomain() (uint32, error) { + return _MessageTransmitter.Contract.LocalDomain(&_MessageTransmitter.CallOpts) +} + +// LocalDomain is a free data retrieval call binding the contract method 0x8d3638f4. +// +// Solidity: function localDomain() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterCallerSession) LocalDomain() (uint32, error) { + return _MessageTransmitter.Contract.LocalDomain(&_MessageTransmitter.CallOpts) +} + +// MaxMessageBodySize is a free data retrieval call binding the contract method 0xaf47b9bb. +// +// Solidity: function maxMessageBodySize() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCaller) MaxMessageBodySize(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "maxMessageBodySize") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// MaxMessageBodySize is a free data retrieval call binding the contract method 0xaf47b9bb. +// +// Solidity: function maxMessageBodySize() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterSession) MaxMessageBodySize() (*big.Int, error) { + return _MessageTransmitter.Contract.MaxMessageBodySize(&_MessageTransmitter.CallOpts) +} + +// MaxMessageBodySize is a free data retrieval call binding the contract method 0xaf47b9bb. +// +// Solidity: function maxMessageBodySize() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCallerSession) MaxMessageBodySize() (*big.Int, error) { + return _MessageTransmitter.Contract.MaxMessageBodySize(&_MessageTransmitter.CallOpts) +} + +// NextAvailableNonce is a free data retrieval call binding the contract method 0x8371744e. +// +// Solidity: function nextAvailableNonce() view returns(uint64) +func (_MessageTransmitter *MessageTransmitterCaller) NextAvailableNonce(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "nextAvailableNonce") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// NextAvailableNonce is a free data retrieval call binding the contract method 0x8371744e. +// +// Solidity: function nextAvailableNonce() view returns(uint64) +func (_MessageTransmitter *MessageTransmitterSession) NextAvailableNonce() (uint64, error) { + return _MessageTransmitter.Contract.NextAvailableNonce(&_MessageTransmitter.CallOpts) +} + +// NextAvailableNonce is a free data retrieval call binding the contract method 0x8371744e. +// +// Solidity: function nextAvailableNonce() view returns(uint64) +func (_MessageTransmitter *MessageTransmitterCallerSession) NextAvailableNonce() (uint64, error) { + return _MessageTransmitter.Contract.NextAvailableNonce(&_MessageTransmitter.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.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 (_MessageTransmitter *MessageTransmitterSession) Owner() (common.Address, error) { + return _MessageTransmitter.Contract.Owner(&_MessageTransmitter.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) Owner() (common.Address, error) { + return _MessageTransmitter.Contract.Owner(&_MessageTransmitter.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_MessageTransmitter *MessageTransmitterCaller) Paused(opts *bind.CallOpts) (bool, error) { + var out []interface{} + err := _MessageTransmitter.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 (_MessageTransmitter *MessageTransmitterSession) Paused() (bool, error) { + return _MessageTransmitter.Contract.Paused(&_MessageTransmitter.CallOpts) +} + +// Paused is a free data retrieval call binding the contract method 0x5c975abb. +// +// Solidity: function paused() view returns(bool) +func (_MessageTransmitter *MessageTransmitterCallerSession) Paused() (bool, error) { + return _MessageTransmitter.Contract.Paused(&_MessageTransmitter.CallOpts) +} + +// Pauser is a free data retrieval call binding the contract method 0x9fd0506d. +// +// Solidity: function pauser() view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) Pauser(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "pauser") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Pauser is a free data retrieval call binding the contract method 0x9fd0506d. +// +// Solidity: function pauser() view returns(address) +func (_MessageTransmitter *MessageTransmitterSession) Pauser() (common.Address, error) { + return _MessageTransmitter.Contract.Pauser(&_MessageTransmitter.CallOpts) +} + +// Pauser is a free data retrieval call binding the contract method 0x9fd0506d. +// +// Solidity: function pauser() view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) Pauser() (common.Address, error) { + return _MessageTransmitter.Contract.Pauser(&_MessageTransmitter.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_MessageTransmitter *MessageTransmitterSession) PendingOwner() (common.Address, error) { + return _MessageTransmitter.Contract.PendingOwner(&_MessageTransmitter.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) PendingOwner() (common.Address, error) { + return _MessageTransmitter.Contract.PendingOwner(&_MessageTransmitter.CallOpts) +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_MessageTransmitter *MessageTransmitterCaller) Rescuer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "rescuer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_MessageTransmitter *MessageTransmitterSession) Rescuer() (common.Address, error) { + return _MessageTransmitter.Contract.Rescuer(&_MessageTransmitter.CallOpts) +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_MessageTransmitter *MessageTransmitterCallerSession) Rescuer() (common.Address, error) { + return _MessageTransmitter.Contract.Rescuer(&_MessageTransmitter.CallOpts) +} + +// SignatureThreshold is a free data retrieval call binding the contract method 0xa82f2e26. +// +// Solidity: function signatureThreshold() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCaller) SignatureThreshold(opts *bind.CallOpts) (*big.Int, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "signatureThreshold") + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// SignatureThreshold is a free data retrieval call binding the contract method 0xa82f2e26. +// +// Solidity: function signatureThreshold() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterSession) SignatureThreshold() (*big.Int, error) { + return _MessageTransmitter.Contract.SignatureThreshold(&_MessageTransmitter.CallOpts) +} + +// SignatureThreshold is a free data retrieval call binding the contract method 0xa82f2e26. +// +// Solidity: function signatureThreshold() view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCallerSession) SignatureThreshold() (*big.Int, error) { + return _MessageTransmitter.Contract.SignatureThreshold(&_MessageTransmitter.CallOpts) +} + +// UsedNonces is a free data retrieval call binding the contract method 0xfeb61724. +// +// Solidity: function usedNonces(bytes32 ) view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCaller) UsedNonces(opts *bind.CallOpts, arg0 [32]byte) (*big.Int, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "usedNonces", arg0) + + if err != nil { + return *new(*big.Int), err + } + + out0 := *abi.ConvertType(out[0], new(*big.Int)).(**big.Int) + + return out0, err + +} + +// UsedNonces is a free data retrieval call binding the contract method 0xfeb61724. +// +// Solidity: function usedNonces(bytes32 ) view returns(uint256) +func (_MessageTransmitter *MessageTransmitterSession) UsedNonces(arg0 [32]byte) (*big.Int, error) { + return _MessageTransmitter.Contract.UsedNonces(&_MessageTransmitter.CallOpts, arg0) +} + +// UsedNonces is a free data retrieval call binding the contract method 0xfeb61724. +// +// Solidity: function usedNonces(bytes32 ) view returns(uint256) +func (_MessageTransmitter *MessageTransmitterCallerSession) UsedNonces(arg0 [32]byte) (*big.Int, error) { + return _MessageTransmitter.Contract.UsedNonces(&_MessageTransmitter.CallOpts, arg0) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterCaller) Version(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _MessageTransmitter.contract.Call(opts, &out, "version") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterSession) Version() (uint32, error) { + return _MessageTransmitter.Contract.Version(&_MessageTransmitter.CallOpts) +} + +// Version is a free data retrieval call binding the contract method 0x54fd4d50. +// +// Solidity: function version() view returns(uint32) +func (_MessageTransmitter *MessageTransmitterCallerSession) Version() (uint32, error) { + return _MessageTransmitter.Contract.Version(&_MessageTransmitter.CallOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_MessageTransmitter *MessageTransmitterTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_MessageTransmitter *MessageTransmitterSession) AcceptOwnership() (*types.Transaction, error) { + return _MessageTransmitter.Contract.AcceptOwnership(&_MessageTransmitter.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _MessageTransmitter.Contract.AcceptOwnership(&_MessageTransmitter.TransactOpts) +} + +// DisableAttester is a paid mutator transaction binding the contract method 0x2d025080. +// +// Solidity: function disableAttester(address attester) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) DisableAttester(opts *bind.TransactOpts, attester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "disableAttester", attester) +} + +// DisableAttester is a paid mutator transaction binding the contract method 0x2d025080. +// +// Solidity: function disableAttester(address attester) returns() +func (_MessageTransmitter *MessageTransmitterSession) DisableAttester(attester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.DisableAttester(&_MessageTransmitter.TransactOpts, attester) +} + +// DisableAttester is a paid mutator transaction binding the contract method 0x2d025080. +// +// Solidity: function disableAttester(address attester) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) DisableAttester(attester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.DisableAttester(&_MessageTransmitter.TransactOpts, attester) +} + +// EnableAttester is a paid mutator transaction binding the contract method 0xfae36879. +// +// Solidity: function enableAttester(address newAttester) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) EnableAttester(opts *bind.TransactOpts, newAttester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "enableAttester", newAttester) +} + +// EnableAttester is a paid mutator transaction binding the contract method 0xfae36879. +// +// Solidity: function enableAttester(address newAttester) returns() +func (_MessageTransmitter *MessageTransmitterSession) EnableAttester(newAttester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.EnableAttester(&_MessageTransmitter.TransactOpts, newAttester) +} + +// EnableAttester is a paid mutator transaction binding the contract method 0xfae36879. +// +// Solidity: function enableAttester(address newAttester) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) EnableAttester(newAttester common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.EnableAttester(&_MessageTransmitter.TransactOpts, newAttester) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_MessageTransmitter *MessageTransmitterTransactor) Pause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "pause") +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_MessageTransmitter *MessageTransmitterSession) Pause() (*types.Transaction, error) { + return _MessageTransmitter.Contract.Pause(&_MessageTransmitter.TransactOpts) +} + +// Pause is a paid mutator transaction binding the contract method 0x8456cb59. +// +// Solidity: function pause() returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) Pause() (*types.Transaction, error) { + return _MessageTransmitter.Contract.Pause(&_MessageTransmitter.TransactOpts) +} + +// ReceiveMessage is a paid mutator transaction binding the contract method 0x57ecfd28. +// +// Solidity: function receiveMessage(bytes message, bytes attestation) returns(bool success) +func (_MessageTransmitter *MessageTransmitterTransactor) ReceiveMessage(opts *bind.TransactOpts, message []byte, attestation []byte) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "receiveMessage", message, attestation) +} + +// ReceiveMessage is a paid mutator transaction binding the contract method 0x57ecfd28. +// +// Solidity: function receiveMessage(bytes message, bytes attestation) returns(bool success) +func (_MessageTransmitter *MessageTransmitterSession) ReceiveMessage(message []byte, attestation []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.ReceiveMessage(&_MessageTransmitter.TransactOpts, message, attestation) +} + +// ReceiveMessage is a paid mutator transaction binding the contract method 0x57ecfd28. +// +// Solidity: function receiveMessage(bytes message, bytes attestation) returns(bool success) +func (_MessageTransmitter *MessageTransmitterTransactorSession) ReceiveMessage(message []byte, attestation []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.ReceiveMessage(&_MessageTransmitter.TransactOpts, message, attestation) +} + +// ReplaceMessage is a paid mutator transaction binding the contract method 0xb857b774. +// +// Solidity: function replaceMessage(bytes originalMessage, bytes originalAttestation, bytes newMessageBody, bytes32 newDestinationCaller) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) ReplaceMessage(opts *bind.TransactOpts, originalMessage []byte, originalAttestation []byte, newMessageBody []byte, newDestinationCaller [32]byte) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "replaceMessage", originalMessage, originalAttestation, newMessageBody, newDestinationCaller) +} + +// ReplaceMessage is a paid mutator transaction binding the contract method 0xb857b774. +// +// Solidity: function replaceMessage(bytes originalMessage, bytes originalAttestation, bytes newMessageBody, bytes32 newDestinationCaller) returns() +func (_MessageTransmitter *MessageTransmitterSession) ReplaceMessage(originalMessage []byte, originalAttestation []byte, newMessageBody []byte, newDestinationCaller [32]byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.ReplaceMessage(&_MessageTransmitter.TransactOpts, originalMessage, originalAttestation, newMessageBody, newDestinationCaller) +} + +// ReplaceMessage is a paid mutator transaction binding the contract method 0xb857b774. +// +// Solidity: function replaceMessage(bytes originalMessage, bytes originalAttestation, bytes newMessageBody, bytes32 newDestinationCaller) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) ReplaceMessage(originalMessage []byte, originalAttestation []byte, newMessageBody []byte, newDestinationCaller [32]byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.ReplaceMessage(&_MessageTransmitter.TransactOpts, originalMessage, originalAttestation, newMessageBody, newDestinationCaller) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) RescueERC20(opts *bind.TransactOpts, tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "rescueERC20", tokenContract, to, amount) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_MessageTransmitter *MessageTransmitterSession) RescueERC20(tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.RescueERC20(&_MessageTransmitter.TransactOpts, tokenContract, to, amount) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) RescueERC20(tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.RescueERC20(&_MessageTransmitter.TransactOpts, tokenContract, to, amount) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x0ba469bc. +// +// Solidity: function sendMessage(uint32 destinationDomain, bytes32 recipient, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterTransactor) SendMessage(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "sendMessage", destinationDomain, recipient, messageBody) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x0ba469bc. +// +// Solidity: function sendMessage(uint32 destinationDomain, bytes32 recipient, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterSession) SendMessage(destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SendMessage(&_MessageTransmitter.TransactOpts, destinationDomain, recipient, messageBody) +} + +// SendMessage is a paid mutator transaction binding the contract method 0x0ba469bc. +// +// Solidity: function sendMessage(uint32 destinationDomain, bytes32 recipient, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterTransactorSession) SendMessage(destinationDomain uint32, recipient [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SendMessage(&_MessageTransmitter.TransactOpts, destinationDomain, recipient, messageBody) +} + +// SendMessageWithCaller is a paid mutator transaction binding the contract method 0xf7259a75. +// +// Solidity: function sendMessageWithCaller(uint32 destinationDomain, bytes32 recipient, bytes32 destinationCaller, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterTransactor) SendMessageWithCaller(opts *bind.TransactOpts, destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "sendMessageWithCaller", destinationDomain, recipient, destinationCaller, messageBody) +} + +// SendMessageWithCaller is a paid mutator transaction binding the contract method 0xf7259a75. +// +// Solidity: function sendMessageWithCaller(uint32 destinationDomain, bytes32 recipient, bytes32 destinationCaller, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterSession) SendMessageWithCaller(destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SendMessageWithCaller(&_MessageTransmitter.TransactOpts, destinationDomain, recipient, destinationCaller, messageBody) +} + +// SendMessageWithCaller is a paid mutator transaction binding the contract method 0xf7259a75. +// +// Solidity: function sendMessageWithCaller(uint32 destinationDomain, bytes32 recipient, bytes32 destinationCaller, bytes messageBody) returns(uint64) +func (_MessageTransmitter *MessageTransmitterTransactorSession) SendMessageWithCaller(destinationDomain uint32, recipient [32]byte, destinationCaller [32]byte, messageBody []byte) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SendMessageWithCaller(&_MessageTransmitter.TransactOpts, destinationDomain, recipient, destinationCaller, messageBody) +} + +// SetMaxMessageBodySize is a paid mutator transaction binding the contract method 0x92492c68. +// +// Solidity: function setMaxMessageBodySize(uint256 newMaxMessageBodySize) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) SetMaxMessageBodySize(opts *bind.TransactOpts, newMaxMessageBodySize *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "setMaxMessageBodySize", newMaxMessageBodySize) +} + +// SetMaxMessageBodySize is a paid mutator transaction binding the contract method 0x92492c68. +// +// Solidity: function setMaxMessageBodySize(uint256 newMaxMessageBodySize) returns() +func (_MessageTransmitter *MessageTransmitterSession) SetMaxMessageBodySize(newMaxMessageBodySize *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SetMaxMessageBodySize(&_MessageTransmitter.TransactOpts, newMaxMessageBodySize) +} + +// SetMaxMessageBodySize is a paid mutator transaction binding the contract method 0x92492c68. +// +// Solidity: function setMaxMessageBodySize(uint256 newMaxMessageBodySize) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) SetMaxMessageBodySize(newMaxMessageBodySize *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SetMaxMessageBodySize(&_MessageTransmitter.TransactOpts, newMaxMessageBodySize) +} + +// SetSignatureThreshold is a paid mutator transaction binding the contract method 0xbbde5374. +// +// Solidity: function setSignatureThreshold(uint256 newSignatureThreshold) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) SetSignatureThreshold(opts *bind.TransactOpts, newSignatureThreshold *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "setSignatureThreshold", newSignatureThreshold) +} + +// SetSignatureThreshold is a paid mutator transaction binding the contract method 0xbbde5374. +// +// Solidity: function setSignatureThreshold(uint256 newSignatureThreshold) returns() +func (_MessageTransmitter *MessageTransmitterSession) SetSignatureThreshold(newSignatureThreshold *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SetSignatureThreshold(&_MessageTransmitter.TransactOpts, newSignatureThreshold) +} + +// SetSignatureThreshold is a paid mutator transaction binding the contract method 0xbbde5374. +// +// Solidity: function setSignatureThreshold(uint256 newSignatureThreshold) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) SetSignatureThreshold(newSignatureThreshold *big.Int) (*types.Transaction, error) { + return _MessageTransmitter.Contract.SetSignatureThreshold(&_MessageTransmitter.TransactOpts, newSignatureThreshold) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_MessageTransmitter *MessageTransmitterSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.TransferOwnership(&_MessageTransmitter.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.TransferOwnership(&_MessageTransmitter.TransactOpts, newOwner) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_MessageTransmitter *MessageTransmitterTransactor) Unpause(opts *bind.TransactOpts) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "unpause") +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_MessageTransmitter *MessageTransmitterSession) Unpause() (*types.Transaction, error) { + return _MessageTransmitter.Contract.Unpause(&_MessageTransmitter.TransactOpts) +} + +// Unpause is a paid mutator transaction binding the contract method 0x3f4ba83a. +// +// Solidity: function unpause() returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) Unpause() (*types.Transaction, error) { + return _MessageTransmitter.Contract.Unpause(&_MessageTransmitter.TransactOpts) +} + +// UpdateAttesterManager is a paid mutator transaction binding the contract method 0xde7769d4. +// +// Solidity: function updateAttesterManager(address newAttesterManager) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) UpdateAttesterManager(opts *bind.TransactOpts, newAttesterManager common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "updateAttesterManager", newAttesterManager) +} + +// UpdateAttesterManager is a paid mutator transaction binding the contract method 0xde7769d4. +// +// Solidity: function updateAttesterManager(address newAttesterManager) returns() +func (_MessageTransmitter *MessageTransmitterSession) UpdateAttesterManager(newAttesterManager common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdateAttesterManager(&_MessageTransmitter.TransactOpts, newAttesterManager) +} + +// UpdateAttesterManager is a paid mutator transaction binding the contract method 0xde7769d4. +// +// Solidity: function updateAttesterManager(address newAttesterManager) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) UpdateAttesterManager(newAttesterManager common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdateAttesterManager(&_MessageTransmitter.TransactOpts, newAttesterManager) +} + +// UpdatePauser is a paid mutator transaction binding the contract method 0x554bab3c. +// +// Solidity: function updatePauser(address _newPauser) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) UpdatePauser(opts *bind.TransactOpts, _newPauser common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "updatePauser", _newPauser) +} + +// UpdatePauser is a paid mutator transaction binding the contract method 0x554bab3c. +// +// Solidity: function updatePauser(address _newPauser) returns() +func (_MessageTransmitter *MessageTransmitterSession) UpdatePauser(_newPauser common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdatePauser(&_MessageTransmitter.TransactOpts, _newPauser) +} + +// UpdatePauser is a paid mutator transaction binding the contract method 0x554bab3c. +// +// Solidity: function updatePauser(address _newPauser) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) UpdatePauser(_newPauser common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdatePauser(&_MessageTransmitter.TransactOpts, _newPauser) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_MessageTransmitter *MessageTransmitterTransactor) UpdateRescuer(opts *bind.TransactOpts, newRescuer common.Address) (*types.Transaction, error) { + return _MessageTransmitter.contract.Transact(opts, "updateRescuer", newRescuer) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_MessageTransmitter *MessageTransmitterSession) UpdateRescuer(newRescuer common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdateRescuer(&_MessageTransmitter.TransactOpts, newRescuer) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_MessageTransmitter *MessageTransmitterTransactorSession) UpdateRescuer(newRescuer common.Address) (*types.Transaction, error) { + return _MessageTransmitter.Contract.UpdateRescuer(&_MessageTransmitter.TransactOpts, newRescuer) +} + +// MessageTransmitterAttesterDisabledIterator is returned from FilterAttesterDisabled and is used to iterate over the raw logs and unpacked data for AttesterDisabled events raised by the MessageTransmitter contract. +type MessageTransmitterAttesterDisabledIterator struct { + Event *MessageTransmitterAttesterDisabled // 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 *MessageTransmitterAttesterDisabledIterator) 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(MessageTransmitterAttesterDisabled) + 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(MessageTransmitterAttesterDisabled) + 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 *MessageTransmitterAttesterDisabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterAttesterDisabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterAttesterDisabled represents a AttesterDisabled event raised by the MessageTransmitter contract. +type MessageTransmitterAttesterDisabled struct { + Attester common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAttesterDisabled is a free log retrieval operation binding the contract event 0x78e573a18c75957b7cadaab01511aa1c19a659f06ecf53e01de37ed92d3261fc. +// +// Solidity: event AttesterDisabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterAttesterDisabled(opts *bind.FilterOpts, attester []common.Address) (*MessageTransmitterAttesterDisabledIterator, error) { + + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "AttesterDisabled", attesterRule) + if err != nil { + return nil, err + } + return &MessageTransmitterAttesterDisabledIterator{contract: _MessageTransmitter.contract, event: "AttesterDisabled", logs: logs, sub: sub}, nil +} + +// WatchAttesterDisabled is a free log subscription operation binding the contract event 0x78e573a18c75957b7cadaab01511aa1c19a659f06ecf53e01de37ed92d3261fc. +// +// Solidity: event AttesterDisabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchAttesterDisabled(opts *bind.WatchOpts, sink chan<- *MessageTransmitterAttesterDisabled, attester []common.Address) (event.Subscription, error) { + + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "AttesterDisabled", attesterRule) + 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(MessageTransmitterAttesterDisabled) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterDisabled", 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 +} + +// ParseAttesterDisabled is a log parse operation binding the contract event 0x78e573a18c75957b7cadaab01511aa1c19a659f06ecf53e01de37ed92d3261fc. +// +// Solidity: event AttesterDisabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseAttesterDisabled(log types.Log) (*MessageTransmitterAttesterDisabled, error) { + event := new(MessageTransmitterAttesterDisabled) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterDisabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterAttesterEnabledIterator is returned from FilterAttesterEnabled and is used to iterate over the raw logs and unpacked data for AttesterEnabled events raised by the MessageTransmitter contract. +type MessageTransmitterAttesterEnabledIterator struct { + Event *MessageTransmitterAttesterEnabled // 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 *MessageTransmitterAttesterEnabledIterator) 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(MessageTransmitterAttesterEnabled) + 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(MessageTransmitterAttesterEnabled) + 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 *MessageTransmitterAttesterEnabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterAttesterEnabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterAttesterEnabled represents a AttesterEnabled event raised by the MessageTransmitter contract. +type MessageTransmitterAttesterEnabled struct { + Attester common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAttesterEnabled is a free log retrieval operation binding the contract event 0x5b99bab45c72ce67e89466dbc47480b9c1fde1400e7268bbf463b8354ee4653f. +// +// Solidity: event AttesterEnabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterAttesterEnabled(opts *bind.FilterOpts, attester []common.Address) (*MessageTransmitterAttesterEnabledIterator, error) { + + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "AttesterEnabled", attesterRule) + if err != nil { + return nil, err + } + return &MessageTransmitterAttesterEnabledIterator{contract: _MessageTransmitter.contract, event: "AttesterEnabled", logs: logs, sub: sub}, nil +} + +// WatchAttesterEnabled is a free log subscription operation binding the contract event 0x5b99bab45c72ce67e89466dbc47480b9c1fde1400e7268bbf463b8354ee4653f. +// +// Solidity: event AttesterEnabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchAttesterEnabled(opts *bind.WatchOpts, sink chan<- *MessageTransmitterAttesterEnabled, attester []common.Address) (event.Subscription, error) { + + var attesterRule []interface{} + for _, attesterItem := range attester { + attesterRule = append(attesterRule, attesterItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "AttesterEnabled", attesterRule) + 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(MessageTransmitterAttesterEnabled) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterEnabled", 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 +} + +// ParseAttesterEnabled is a log parse operation binding the contract event 0x5b99bab45c72ce67e89466dbc47480b9c1fde1400e7268bbf463b8354ee4653f. +// +// Solidity: event AttesterEnabled(address indexed attester) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseAttesterEnabled(log types.Log) (*MessageTransmitterAttesterEnabled, error) { + event := new(MessageTransmitterAttesterEnabled) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterEnabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterAttesterManagerUpdatedIterator is returned from FilterAttesterManagerUpdated and is used to iterate over the raw logs and unpacked data for AttesterManagerUpdated events raised by the MessageTransmitter contract. +type MessageTransmitterAttesterManagerUpdatedIterator struct { + Event *MessageTransmitterAttesterManagerUpdated // 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 *MessageTransmitterAttesterManagerUpdatedIterator) 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(MessageTransmitterAttesterManagerUpdated) + 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(MessageTransmitterAttesterManagerUpdated) + 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 *MessageTransmitterAttesterManagerUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterAttesterManagerUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterAttesterManagerUpdated represents a AttesterManagerUpdated event raised by the MessageTransmitter contract. +type MessageTransmitterAttesterManagerUpdated struct { + PreviousAttesterManager common.Address + NewAttesterManager common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterAttesterManagerUpdated is a free log retrieval operation binding the contract event 0x0cee1b7ae04f3c788dd3a46c6fa677eb95b913611ef7ab59524fdc09d3460219. +// +// Solidity: event AttesterManagerUpdated(address indexed previousAttesterManager, address indexed newAttesterManager) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterAttesterManagerUpdated(opts *bind.FilterOpts, previousAttesterManager []common.Address, newAttesterManager []common.Address) (*MessageTransmitterAttesterManagerUpdatedIterator, error) { + + var previousAttesterManagerRule []interface{} + for _, previousAttesterManagerItem := range previousAttesterManager { + previousAttesterManagerRule = append(previousAttesterManagerRule, previousAttesterManagerItem) + } + var newAttesterManagerRule []interface{} + for _, newAttesterManagerItem := range newAttesterManager { + newAttesterManagerRule = append(newAttesterManagerRule, newAttesterManagerItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "AttesterManagerUpdated", previousAttesterManagerRule, newAttesterManagerRule) + if err != nil { + return nil, err + } + return &MessageTransmitterAttesterManagerUpdatedIterator{contract: _MessageTransmitter.contract, event: "AttesterManagerUpdated", logs: logs, sub: sub}, nil +} + +// WatchAttesterManagerUpdated is a free log subscription operation binding the contract event 0x0cee1b7ae04f3c788dd3a46c6fa677eb95b913611ef7ab59524fdc09d3460219. +// +// Solidity: event AttesterManagerUpdated(address indexed previousAttesterManager, address indexed newAttesterManager) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchAttesterManagerUpdated(opts *bind.WatchOpts, sink chan<- *MessageTransmitterAttesterManagerUpdated, previousAttesterManager []common.Address, newAttesterManager []common.Address) (event.Subscription, error) { + + var previousAttesterManagerRule []interface{} + for _, previousAttesterManagerItem := range previousAttesterManager { + previousAttesterManagerRule = append(previousAttesterManagerRule, previousAttesterManagerItem) + } + var newAttesterManagerRule []interface{} + for _, newAttesterManagerItem := range newAttesterManager { + newAttesterManagerRule = append(newAttesterManagerRule, newAttesterManagerItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "AttesterManagerUpdated", previousAttesterManagerRule, newAttesterManagerRule) + 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(MessageTransmitterAttesterManagerUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterManagerUpdated", 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 +} + +// ParseAttesterManagerUpdated is a log parse operation binding the contract event 0x0cee1b7ae04f3c788dd3a46c6fa677eb95b913611ef7ab59524fdc09d3460219. +// +// Solidity: event AttesterManagerUpdated(address indexed previousAttesterManager, address indexed newAttesterManager) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseAttesterManagerUpdated(log types.Log) (*MessageTransmitterAttesterManagerUpdated, error) { + event := new(MessageTransmitterAttesterManagerUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "AttesterManagerUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterMaxMessageBodySizeUpdatedIterator is returned from FilterMaxMessageBodySizeUpdated and is used to iterate over the raw logs and unpacked data for MaxMessageBodySizeUpdated events raised by the MessageTransmitter contract. +type MessageTransmitterMaxMessageBodySizeUpdatedIterator struct { + Event *MessageTransmitterMaxMessageBodySizeUpdated // 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 *MessageTransmitterMaxMessageBodySizeUpdatedIterator) 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(MessageTransmitterMaxMessageBodySizeUpdated) + 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(MessageTransmitterMaxMessageBodySizeUpdated) + 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 *MessageTransmitterMaxMessageBodySizeUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterMaxMessageBodySizeUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterMaxMessageBodySizeUpdated represents a MaxMessageBodySizeUpdated event raised by the MessageTransmitter contract. +type MessageTransmitterMaxMessageBodySizeUpdated struct { + NewMaxMessageBodySize *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMaxMessageBodySizeUpdated is a free log retrieval operation binding the contract event 0xb13bf6bebed03d1b318e3ea32e4b2a3ad9f5e2312cdf340a2f4bbfaee39f928d. +// +// Solidity: event MaxMessageBodySizeUpdated(uint256 newMaxMessageBodySize) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterMaxMessageBodySizeUpdated(opts *bind.FilterOpts) (*MessageTransmitterMaxMessageBodySizeUpdatedIterator, error) { + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "MaxMessageBodySizeUpdated") + if err != nil { + return nil, err + } + return &MessageTransmitterMaxMessageBodySizeUpdatedIterator{contract: _MessageTransmitter.contract, event: "MaxMessageBodySizeUpdated", logs: logs, sub: sub}, nil +} + +// WatchMaxMessageBodySizeUpdated is a free log subscription operation binding the contract event 0xb13bf6bebed03d1b318e3ea32e4b2a3ad9f5e2312cdf340a2f4bbfaee39f928d. +// +// Solidity: event MaxMessageBodySizeUpdated(uint256 newMaxMessageBodySize) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchMaxMessageBodySizeUpdated(opts *bind.WatchOpts, sink chan<- *MessageTransmitterMaxMessageBodySizeUpdated) (event.Subscription, error) { + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "MaxMessageBodySizeUpdated") + 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(MessageTransmitterMaxMessageBodySizeUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "MaxMessageBodySizeUpdated", 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 +} + +// ParseMaxMessageBodySizeUpdated is a log parse operation binding the contract event 0xb13bf6bebed03d1b318e3ea32e4b2a3ad9f5e2312cdf340a2f4bbfaee39f928d. +// +// Solidity: event MaxMessageBodySizeUpdated(uint256 newMaxMessageBodySize) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseMaxMessageBodySizeUpdated(log types.Log) (*MessageTransmitterMaxMessageBodySizeUpdated, error) { + event := new(MessageTransmitterMaxMessageBodySizeUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "MaxMessageBodySizeUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterMessageReceivedIterator is returned from FilterMessageReceived and is used to iterate over the raw logs and unpacked data for MessageReceived events raised by the MessageTransmitter contract. +type MessageTransmitterMessageReceivedIterator struct { + Event *MessageTransmitterMessageReceived // 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 *MessageTransmitterMessageReceivedIterator) 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(MessageTransmitterMessageReceived) + 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(MessageTransmitterMessageReceived) + 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 *MessageTransmitterMessageReceivedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterMessageReceivedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterMessageReceived represents a MessageReceived event raised by the MessageTransmitter contract. +type MessageTransmitterMessageReceived struct { + Caller common.Address + SourceDomain uint32 + Nonce uint64 + Sender [32]byte + MessageBody []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMessageReceived is a free log retrieval operation binding the contract event 0x58200b4c34ae05ee816d710053fff3fb75af4395915d3d2a771b24aa10e3cc5d. +// +// Solidity: event MessageReceived(address indexed caller, uint32 sourceDomain, uint64 indexed nonce, bytes32 sender, bytes messageBody) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterMessageReceived(opts *bind.FilterOpts, caller []common.Address, nonce []uint64) (*MessageTransmitterMessageReceivedIterator, error) { + + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "MessageReceived", callerRule, nonceRule) + if err != nil { + return nil, err + } + return &MessageTransmitterMessageReceivedIterator{contract: _MessageTransmitter.contract, event: "MessageReceived", logs: logs, sub: sub}, nil +} + +// WatchMessageReceived is a free log subscription operation binding the contract event 0x58200b4c34ae05ee816d710053fff3fb75af4395915d3d2a771b24aa10e3cc5d. +// +// Solidity: event MessageReceived(address indexed caller, uint32 sourceDomain, uint64 indexed nonce, bytes32 sender, bytes messageBody) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchMessageReceived(opts *bind.WatchOpts, sink chan<- *MessageTransmitterMessageReceived, caller []common.Address, nonce []uint64) (event.Subscription, error) { + + var callerRule []interface{} + for _, callerItem := range caller { + callerRule = append(callerRule, callerItem) + } + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "MessageReceived", callerRule, nonceRule) + 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(MessageTransmitterMessageReceived) + if err := _MessageTransmitter.contract.UnpackLog(event, "MessageReceived", 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 +} + +// ParseMessageReceived is a log parse operation binding the contract event 0x58200b4c34ae05ee816d710053fff3fb75af4395915d3d2a771b24aa10e3cc5d. +// +// Solidity: event MessageReceived(address indexed caller, uint32 sourceDomain, uint64 indexed nonce, bytes32 sender, bytes messageBody) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseMessageReceived(log types.Log) (*MessageTransmitterMessageReceived, error) { + event := new(MessageTransmitterMessageReceived) + if err := _MessageTransmitter.contract.UnpackLog(event, "MessageReceived", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterMessageSentIterator is returned from FilterMessageSent and is used to iterate over the raw logs and unpacked data for MessageSent events raised by the MessageTransmitter contract. +type MessageTransmitterMessageSentIterator struct { + Event *MessageTransmitterMessageSent // 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 *MessageTransmitterMessageSentIterator) 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(MessageTransmitterMessageSent) + 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(MessageTransmitterMessageSent) + 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 *MessageTransmitterMessageSentIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterMessageSentIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterMessageSent represents a MessageSent event raised by the MessageTransmitter contract. +type MessageTransmitterMessageSent struct { + Message []byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMessageSent is a free log retrieval operation binding the contract event 0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036. +// +// Solidity: event MessageSent(bytes message) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterMessageSent(opts *bind.FilterOpts) (*MessageTransmitterMessageSentIterator, error) { + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "MessageSent") + if err != nil { + return nil, err + } + return &MessageTransmitterMessageSentIterator{contract: _MessageTransmitter.contract, event: "MessageSent", logs: logs, sub: sub}, nil +} + +// WatchMessageSent is a free log subscription operation binding the contract event 0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036. +// +// Solidity: event MessageSent(bytes message) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchMessageSent(opts *bind.WatchOpts, sink chan<- *MessageTransmitterMessageSent) (event.Subscription, error) { + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "MessageSent") + 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(MessageTransmitterMessageSent) + if err := _MessageTransmitter.contract.UnpackLog(event, "MessageSent", 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 +} + +// ParseMessageSent is a log parse operation binding the contract event 0x8c5261668696ce22758910d05bab8f186d6eb247ceac2af2e82c7dc17669b036. +// +// Solidity: event MessageSent(bytes message) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseMessageSent(log types.Log) (*MessageTransmitterMessageSent, error) { + event := new(MessageTransmitterMessageSent) + if err := _MessageTransmitter.contract.UnpackLog(event, "MessageSent", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the MessageTransmitter contract. +type MessageTransmitterOwnershipTransferStartedIterator struct { + Event *MessageTransmitterOwnershipTransferStarted // 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 *MessageTransmitterOwnershipTransferStartedIterator) 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(MessageTransmitterOwnershipTransferStarted) + 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(MessageTransmitterOwnershipTransferStarted) + 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 *MessageTransmitterOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the MessageTransmitter contract. +type MessageTransmitterOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*MessageTransmitterOwnershipTransferStartedIterator, 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 := _MessageTransmitter.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &MessageTransmitterOwnershipTransferStartedIterator{contract: _MessageTransmitter.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *MessageTransmitterOwnershipTransferStarted, 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 := _MessageTransmitter.contract.WatchLogs(opts, "OwnershipTransferStarted", 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(MessageTransmitterOwnershipTransferStarted) + if err := _MessageTransmitter.contract.UnpackLog(event, "OwnershipTransferStarted", 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 +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseOwnershipTransferStarted(log types.Log) (*MessageTransmitterOwnershipTransferStarted, error) { + event := new(MessageTransmitterOwnershipTransferStarted) + if err := _MessageTransmitter.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the MessageTransmitter contract. +type MessageTransmitterOwnershipTransferredIterator struct { + Event *MessageTransmitterOwnershipTransferred // 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 *MessageTransmitterOwnershipTransferredIterator) 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(MessageTransmitterOwnershipTransferred) + 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(MessageTransmitterOwnershipTransferred) + 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 *MessageTransmitterOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterOwnershipTransferred represents a OwnershipTransferred event raised by the MessageTransmitter contract. +type MessageTransmitterOwnershipTransferred 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 (_MessageTransmitter *MessageTransmitterFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*MessageTransmitterOwnershipTransferredIterator, 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 := _MessageTransmitter.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &MessageTransmitterOwnershipTransferredIterator{contract: _MessageTransmitter.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 (_MessageTransmitter *MessageTransmitterFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *MessageTransmitterOwnershipTransferred, 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 := _MessageTransmitter.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(MessageTransmitterOwnershipTransferred) + if err := _MessageTransmitter.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 (_MessageTransmitter *MessageTransmitterFilterer) ParseOwnershipTransferred(log types.Log) (*MessageTransmitterOwnershipTransferred, error) { + event := new(MessageTransmitterOwnershipTransferred) + if err := _MessageTransmitter.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterPauseIterator is returned from FilterPause and is used to iterate over the raw logs and unpacked data for Pause events raised by the MessageTransmitter contract. +type MessageTransmitterPauseIterator struct { + Event *MessageTransmitterPause // 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 *MessageTransmitterPauseIterator) 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(MessageTransmitterPause) + 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(MessageTransmitterPause) + 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 *MessageTransmitterPauseIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterPauseIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterPause represents a Pause event raised by the MessageTransmitter contract. +type MessageTransmitterPause struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPause is a free log retrieval operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625. +// +// Solidity: event Pause() +func (_MessageTransmitter *MessageTransmitterFilterer) FilterPause(opts *bind.FilterOpts) (*MessageTransmitterPauseIterator, error) { + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "Pause") + if err != nil { + return nil, err + } + return &MessageTransmitterPauseIterator{contract: _MessageTransmitter.contract, event: "Pause", logs: logs, sub: sub}, nil +} + +// WatchPause is a free log subscription operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625. +// +// Solidity: event Pause() +func (_MessageTransmitter *MessageTransmitterFilterer) WatchPause(opts *bind.WatchOpts, sink chan<- *MessageTransmitterPause) (event.Subscription, error) { + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "Pause") + 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(MessageTransmitterPause) + if err := _MessageTransmitter.contract.UnpackLog(event, "Pause", 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 +} + +// ParsePause is a log parse operation binding the contract event 0x6985a02210a168e66602d3235cb6db0e70f92b3ba4d376a33c0f3d9434bff625. +// +// Solidity: event Pause() +func (_MessageTransmitter *MessageTransmitterFilterer) ParsePause(log types.Log) (*MessageTransmitterPause, error) { + event := new(MessageTransmitterPause) + if err := _MessageTransmitter.contract.UnpackLog(event, "Pause", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterPauserChangedIterator is returned from FilterPauserChanged and is used to iterate over the raw logs and unpacked data for PauserChanged events raised by the MessageTransmitter contract. +type MessageTransmitterPauserChangedIterator struct { + Event *MessageTransmitterPauserChanged // 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 *MessageTransmitterPauserChangedIterator) 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(MessageTransmitterPauserChanged) + 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(MessageTransmitterPauserChanged) + 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 *MessageTransmitterPauserChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterPauserChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterPauserChanged represents a PauserChanged event raised by the MessageTransmitter contract. +type MessageTransmitterPauserChanged struct { + NewAddress common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterPauserChanged is a free log retrieval operation binding the contract event 0xb80482a293ca2e013eda8683c9bd7fc8347cfdaeea5ede58cba46df502c2a604. +// +// Solidity: event PauserChanged(address indexed newAddress) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterPauserChanged(opts *bind.FilterOpts, newAddress []common.Address) (*MessageTransmitterPauserChangedIterator, error) { + + var newAddressRule []interface{} + for _, newAddressItem := range newAddress { + newAddressRule = append(newAddressRule, newAddressItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "PauserChanged", newAddressRule) + if err != nil { + return nil, err + } + return &MessageTransmitterPauserChangedIterator{contract: _MessageTransmitter.contract, event: "PauserChanged", logs: logs, sub: sub}, nil +} + +// WatchPauserChanged is a free log subscription operation binding the contract event 0xb80482a293ca2e013eda8683c9bd7fc8347cfdaeea5ede58cba46df502c2a604. +// +// Solidity: event PauserChanged(address indexed newAddress) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchPauserChanged(opts *bind.WatchOpts, sink chan<- *MessageTransmitterPauserChanged, newAddress []common.Address) (event.Subscription, error) { + + var newAddressRule []interface{} + for _, newAddressItem := range newAddress { + newAddressRule = append(newAddressRule, newAddressItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "PauserChanged", newAddressRule) + 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(MessageTransmitterPauserChanged) + if err := _MessageTransmitter.contract.UnpackLog(event, "PauserChanged", 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 +} + +// ParsePauserChanged is a log parse operation binding the contract event 0xb80482a293ca2e013eda8683c9bd7fc8347cfdaeea5ede58cba46df502c2a604. +// +// Solidity: event PauserChanged(address indexed newAddress) +func (_MessageTransmitter *MessageTransmitterFilterer) ParsePauserChanged(log types.Log) (*MessageTransmitterPauserChanged, error) { + event := new(MessageTransmitterPauserChanged) + if err := _MessageTransmitter.contract.UnpackLog(event, "PauserChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterRescuerChangedIterator is returned from FilterRescuerChanged and is used to iterate over the raw logs and unpacked data for RescuerChanged events raised by the MessageTransmitter contract. +type MessageTransmitterRescuerChangedIterator struct { + Event *MessageTransmitterRescuerChanged // 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 *MessageTransmitterRescuerChangedIterator) 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(MessageTransmitterRescuerChanged) + 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(MessageTransmitterRescuerChanged) + 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 *MessageTransmitterRescuerChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterRescuerChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterRescuerChanged represents a RescuerChanged event raised by the MessageTransmitter contract. +type MessageTransmitterRescuerChanged struct { + NewRescuer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRescuerChanged is a free log retrieval operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterRescuerChanged(opts *bind.FilterOpts, newRescuer []common.Address) (*MessageTransmitterRescuerChangedIterator, error) { + + var newRescuerRule []interface{} + for _, newRescuerItem := range newRescuer { + newRescuerRule = append(newRescuerRule, newRescuerItem) + } + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "RescuerChanged", newRescuerRule) + if err != nil { + return nil, err + } + return &MessageTransmitterRescuerChangedIterator{contract: _MessageTransmitter.contract, event: "RescuerChanged", logs: logs, sub: sub}, nil +} + +// WatchRescuerChanged is a free log subscription operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchRescuerChanged(opts *bind.WatchOpts, sink chan<- *MessageTransmitterRescuerChanged, newRescuer []common.Address) (event.Subscription, error) { + + var newRescuerRule []interface{} + for _, newRescuerItem := range newRescuer { + newRescuerRule = append(newRescuerRule, newRescuerItem) + } + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "RescuerChanged", newRescuerRule) + 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(MessageTransmitterRescuerChanged) + if err := _MessageTransmitter.contract.UnpackLog(event, "RescuerChanged", 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 +} + +// ParseRescuerChanged is a log parse operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseRescuerChanged(log types.Log) (*MessageTransmitterRescuerChanged, error) { + event := new(MessageTransmitterRescuerChanged) + if err := _MessageTransmitter.contract.UnpackLog(event, "RescuerChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterSignatureThresholdUpdatedIterator is returned from FilterSignatureThresholdUpdated and is used to iterate over the raw logs and unpacked data for SignatureThresholdUpdated events raised by the MessageTransmitter contract. +type MessageTransmitterSignatureThresholdUpdatedIterator struct { + Event *MessageTransmitterSignatureThresholdUpdated // 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 *MessageTransmitterSignatureThresholdUpdatedIterator) 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(MessageTransmitterSignatureThresholdUpdated) + 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(MessageTransmitterSignatureThresholdUpdated) + 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 *MessageTransmitterSignatureThresholdUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterSignatureThresholdUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterSignatureThresholdUpdated represents a SignatureThresholdUpdated event raised by the MessageTransmitter contract. +type MessageTransmitterSignatureThresholdUpdated struct { + OldSignatureThreshold *big.Int + NewSignatureThreshold *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterSignatureThresholdUpdated is a free log retrieval operation binding the contract event 0x149153f58b4da003a8cfd4523709a202402182cb5aa335046911277a1be6eede. +// +// Solidity: event SignatureThresholdUpdated(uint256 oldSignatureThreshold, uint256 newSignatureThreshold) +func (_MessageTransmitter *MessageTransmitterFilterer) FilterSignatureThresholdUpdated(opts *bind.FilterOpts) (*MessageTransmitterSignatureThresholdUpdatedIterator, error) { + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "SignatureThresholdUpdated") + if err != nil { + return nil, err + } + return &MessageTransmitterSignatureThresholdUpdatedIterator{contract: _MessageTransmitter.contract, event: "SignatureThresholdUpdated", logs: logs, sub: sub}, nil +} + +// WatchSignatureThresholdUpdated is a free log subscription operation binding the contract event 0x149153f58b4da003a8cfd4523709a202402182cb5aa335046911277a1be6eede. +// +// Solidity: event SignatureThresholdUpdated(uint256 oldSignatureThreshold, uint256 newSignatureThreshold) +func (_MessageTransmitter *MessageTransmitterFilterer) WatchSignatureThresholdUpdated(opts *bind.WatchOpts, sink chan<- *MessageTransmitterSignatureThresholdUpdated) (event.Subscription, error) { + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "SignatureThresholdUpdated") + 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(MessageTransmitterSignatureThresholdUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "SignatureThresholdUpdated", 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 +} + +// ParseSignatureThresholdUpdated is a log parse operation binding the contract event 0x149153f58b4da003a8cfd4523709a202402182cb5aa335046911277a1be6eede. +// +// Solidity: event SignatureThresholdUpdated(uint256 oldSignatureThreshold, uint256 newSignatureThreshold) +func (_MessageTransmitter *MessageTransmitterFilterer) ParseSignatureThresholdUpdated(log types.Log) (*MessageTransmitterSignatureThresholdUpdated, error) { + event := new(MessageTransmitterSignatureThresholdUpdated) + if err := _MessageTransmitter.contract.UnpackLog(event, "SignatureThresholdUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// MessageTransmitterUnpauseIterator is returned from FilterUnpause and is used to iterate over the raw logs and unpacked data for Unpause events raised by the MessageTransmitter contract. +type MessageTransmitterUnpauseIterator struct { + Event *MessageTransmitterUnpause // 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 *MessageTransmitterUnpauseIterator) 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(MessageTransmitterUnpause) + 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(MessageTransmitterUnpause) + 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 *MessageTransmitterUnpauseIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *MessageTransmitterUnpauseIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// MessageTransmitterUnpause represents a Unpause event raised by the MessageTransmitter contract. +type MessageTransmitterUnpause struct { + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnpause is a free log retrieval operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33. +// +// Solidity: event Unpause() +func (_MessageTransmitter *MessageTransmitterFilterer) FilterUnpause(opts *bind.FilterOpts) (*MessageTransmitterUnpauseIterator, error) { + + logs, sub, err := _MessageTransmitter.contract.FilterLogs(opts, "Unpause") + if err != nil { + return nil, err + } + return &MessageTransmitterUnpauseIterator{contract: _MessageTransmitter.contract, event: "Unpause", logs: logs, sub: sub}, nil +} + +// WatchUnpause is a free log subscription operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33. +// +// Solidity: event Unpause() +func (_MessageTransmitter *MessageTransmitterFilterer) WatchUnpause(opts *bind.WatchOpts, sink chan<- *MessageTransmitterUnpause) (event.Subscription, error) { + + logs, sub, err := _MessageTransmitter.contract.WatchLogs(opts, "Unpause") + 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(MessageTransmitterUnpause) + if err := _MessageTransmitter.contract.UnpackLog(event, "Unpause", 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 +} + +// ParseUnpause is a log parse operation binding the contract event 0x7805862f689e2f13df9f062ff482ad3ad112aca9e0847911ed832e158c525b33. +// +// Solidity: event Unpause() +func (_MessageTransmitter *MessageTransmitterFilterer) ParseUnpause(log types.Log) (*MessageTransmitterUnpause, error) { + event := new(MessageTransmitterUnpause) + if err := _MessageTransmitter.contract.UnpackLog(event, "Unpause", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/dex/networks/erc20/cctp/MessageTransmitter.json b/dex/networks/erc20/cctp/MessageTransmitter.json new file mode 100644 index 0000000000..bafe03782f --- /dev/null +++ b/dex/networks/erc20/cctp/MessageTransmitter.json @@ -0,0 +1,707 @@ +[ + { + "inputs": [ + { + "internalType": "uint32", + "name": "_localDomain", + "type": "uint32" + }, + { + "internalType": "address", + "name": "_attester", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_maxMessageBodySize", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "_version", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "attester", + "type": "address" + } + ], + "name": "AttesterDisabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "attester", + "type": "address" + } + ], + "name": "AttesterEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousAttesterManager", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newAttesterManager", + "type": "address" + } + ], + "name": "AttesterManagerUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "newMaxMessageBodySize", + "type": "uint256" + } + ], + "name": "MaxMessageBodySizeUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "sourceDomain", + "type": "uint32" + }, + { + "indexed": true, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "messageBody", + "type": "bytes" + } + ], + "name": "MessageReceived", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "bytes", + "name": "message", + "type": "bytes" + } + ], + "name": "MessageSent", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Pause", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newAddress", + "type": "address" + } + ], + "name": "PauserChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "RescuerChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "oldSignatureThreshold", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newSignatureThreshold", + "type": "uint256" + } + ], + "name": "SignatureThresholdUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "Unpause", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "attesterManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "attester", + "type": "address" + } + ], + "name": "disableAttester", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAttester", + "type": "address" + } + ], + "name": "enableAttester", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "index", + "type": "uint256" + } + ], + "name": "getEnabledAttester", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getNumEnabledAttesters", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "attester", + "type": "address" + } + ], + "name": "isEnabledAttester", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "localDomain", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxMessageBodySize", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "nextAvailableNonce", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pauser", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "attestation", + "type": "bytes" + } + ], + "name": "receiveMessage", + "outputs": [ + { + "internalType": "bool", + "name": "success", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "originalMessage", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "originalAttestation", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "newMessageBody", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "newDestinationCaller", + "type": "bytes32" + } + ], + "name": "replaceMessage", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "rescueERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rescuer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "messageBody", + "type": "bytes" + } + ], + "name": "sendMessage", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "recipient", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "destinationCaller", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "messageBody", + "type": "bytes" + } + ], + "name": "sendMessageWithCaller", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newMaxMessageBodySize", + "type": "uint256" + } + ], + "name": "setMaxMessageBodySize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "newSignatureThreshold", + "type": "uint256" + } + ], + "name": "setSignatureThreshold", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "signatureThreshold", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAttesterManager", + "type": "address" + } + ], + "name": "updateAttesterManager", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_newPauser", + "type": "address" + } + ], + "name": "updatePauser", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "updateRescuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "name": "usedNonces", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "version", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + } + ] \ No newline at end of file diff --git a/dex/networks/erc20/cctp/TokenMessenger.go b/dex/networks/erc20/cctp/TokenMessenger.go new file mode 100644 index 0000000000..4d3bb943e4 --- /dev/null +++ b/dex/networks/erc20/cctp/TokenMessenger.go @@ -0,0 +1,1963 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package cctp + +import ( + "errors" + "math/big" + "strings" + + ethereum "github.com/ethereum/go-ethereum" + "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" +) + +// Reference imports to suppress errors if they are not otherwise used. +var ( + _ = errors.New + _ = big.NewInt + _ = strings.NewReader + _ = ethereum.NotFound + _ = bind.Bind + _ = common.Big1 + _ = types.BloomLookup + _ = event.NewSubscription + _ = abi.ConvertType +) + +// TokenMessengerMetaData contains all meta data concerning the TokenMessenger contract. +var TokenMessengerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_messageTransmitter\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"_messageBodyVersion\",\"type\":\"uint32\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"burnToken\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"mintRecipient\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destinationTokenMessenger\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"}],\"name\":\"DepositForBurn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"localMinter\",\"type\":\"address\"}],\"name\":\"LocalMinterAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"localMinter\",\"type\":\"address\"}],\"name\":\"LocalMinterRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"mintRecipient\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"mintToken\",\"type\":\"address\"}],\"name\":\"MintAndWithdraw\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferStarted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"domain\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"tokenMessenger\",\"type\":\"bytes32\"}],\"name\":\"RemoteTokenMessengerAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"domain\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"tokenMessenger\",\"type\":\"bytes32\"}],\"name\":\"RemoteTokenMessengerRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newRescuer\",\"type\":\"address\"}],\"name\":\"RescuerChanged\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"acceptOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newLocalMinter\",\"type\":\"address\"}],\"name\":\"addLocalMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"domain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"tokenMessenger\",\"type\":\"bytes32\"}],\"name\":\"addRemoteTokenMessenger\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"mintRecipient\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"burnToken\",\"type\":\"address\"}],\"name\":\"depositForBurn\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"_nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"destinationDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"mintRecipient\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"burnToken\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"destinationCaller\",\"type\":\"bytes32\"}],\"name\":\"depositForBurnWithCaller\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"remoteDomain\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"sender\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"messageBody\",\"type\":\"bytes\"}],\"name\":\"handleReceiveMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"localMessageTransmitter\",\"outputs\":[{\"internalType\":\"contractIMessageTransmitter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"localMinter\",\"outputs\":[{\"internalType\":\"contractITokenMinter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"messageBodyVersion\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"name\":\"remoteTokenMessengers\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"removeLocalMinter\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"domain\",\"type\":\"uint32\"}],\"name\":\"removeRemoteTokenMessenger\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"originalMessage\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"originalAttestation\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"newDestinationCaller\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"newMintRecipient\",\"type\":\"bytes32\"}],\"name\":\"replaceDepositForBurn\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractIERC20\",\"name\":\"tokenContract\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"}],\"name\":\"rescueERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rescuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newRescuer\",\"type\":\"address\"}],\"name\":\"updateRescuer\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// TokenMessengerABI is the input ABI used to generate the binding from. +// Deprecated: Use TokenMessengerMetaData.ABI instead. +var TokenMessengerABI = TokenMessengerMetaData.ABI + +// TokenMessenger is an auto generated Go binding around an Ethereum contract. +type TokenMessenger struct { + TokenMessengerCaller // Read-only binding to the contract + TokenMessengerTransactor // Write-only binding to the contract + TokenMessengerFilterer // Log filterer for contract events +} + +// TokenMessengerCaller is an auto generated read-only Go binding around an Ethereum contract. +type TokenMessengerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenMessengerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type TokenMessengerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenMessengerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type TokenMessengerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// TokenMessengerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type TokenMessengerSession struct { + Contract *TokenMessenger // Generic contract binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TokenMessengerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type TokenMessengerCallerSession struct { + Contract *TokenMessengerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// TokenMessengerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type TokenMessengerTransactorSession struct { + Contract *TokenMessengerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// TokenMessengerRaw is an auto generated low-level Go binding around an Ethereum contract. +type TokenMessengerRaw struct { + Contract *TokenMessenger // Generic contract binding to access the raw methods on +} + +// TokenMessengerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type TokenMessengerCallerRaw struct { + Contract *TokenMessengerCaller // Generic read-only contract binding to access the raw methods on +} + +// TokenMessengerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type TokenMessengerTransactorRaw struct { + Contract *TokenMessengerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewTokenMessenger creates a new instance of TokenMessenger, bound to a specific deployed contract. +func NewTokenMessenger(address common.Address, backend bind.ContractBackend) (*TokenMessenger, error) { + contract, err := bindTokenMessenger(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &TokenMessenger{TokenMessengerCaller: TokenMessengerCaller{contract: contract}, TokenMessengerTransactor: TokenMessengerTransactor{contract: contract}, TokenMessengerFilterer: TokenMessengerFilterer{contract: contract}}, nil +} + +// NewTokenMessengerCaller creates a new read-only instance of TokenMessenger, bound to a specific deployed contract. +func NewTokenMessengerCaller(address common.Address, caller bind.ContractCaller) (*TokenMessengerCaller, error) { + contract, err := bindTokenMessenger(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &TokenMessengerCaller{contract: contract}, nil +} + +// NewTokenMessengerTransactor creates a new write-only instance of TokenMessenger, bound to a specific deployed contract. +func NewTokenMessengerTransactor(address common.Address, transactor bind.ContractTransactor) (*TokenMessengerTransactor, error) { + contract, err := bindTokenMessenger(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &TokenMessengerTransactor{contract: contract}, nil +} + +// NewTokenMessengerFilterer creates a new log filterer instance of TokenMessenger, bound to a specific deployed contract. +func NewTokenMessengerFilterer(address common.Address, filterer bind.ContractFilterer) (*TokenMessengerFilterer, error) { + contract, err := bindTokenMessenger(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &TokenMessengerFilterer{contract: contract}, nil +} + +// bindTokenMessenger binds a generic wrapper to an already deployed contract. +func bindTokenMessenger(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := TokenMessengerMetaData.GetAbi() + if err != nil { + return nil, err + } + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TokenMessenger *TokenMessengerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenMessenger.Contract.TokenMessengerCaller.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TokenMessenger *TokenMessengerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenMessenger.Contract.TokenMessengerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TokenMessenger *TokenMessengerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenMessenger.Contract.TokenMessengerTransactor.contract.Transact(opts, method, params...) +} + +// Call invokes the (constant) contract method with params as input values and +// sets the output to result. The result type might be a single field for simple +// returns, a slice of interfaces for anonymous returns and a struct for named +// returns. +func (_TokenMessenger *TokenMessengerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _TokenMessenger.Contract.contract.Call(opts, result, method, params...) +} + +// Transfer initiates a plain transaction to move funds to the contract, calling +// its default method if one is available. +func (_TokenMessenger *TokenMessengerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenMessenger.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_TokenMessenger *TokenMessengerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _TokenMessenger.Contract.contract.Transact(opts, method, params...) +} + +// LocalMessageTransmitter is a free data retrieval call binding the contract method 0x2c121921. +// +// Solidity: function localMessageTransmitter() view returns(address) +func (_TokenMessenger *TokenMessengerCaller) LocalMessageTransmitter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "localMessageTransmitter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// LocalMessageTransmitter is a free data retrieval call binding the contract method 0x2c121921. +// +// Solidity: function localMessageTransmitter() view returns(address) +func (_TokenMessenger *TokenMessengerSession) LocalMessageTransmitter() (common.Address, error) { + return _TokenMessenger.Contract.LocalMessageTransmitter(&_TokenMessenger.CallOpts) +} + +// LocalMessageTransmitter is a free data retrieval call binding the contract method 0x2c121921. +// +// Solidity: function localMessageTransmitter() view returns(address) +func (_TokenMessenger *TokenMessengerCallerSession) LocalMessageTransmitter() (common.Address, error) { + return _TokenMessenger.Contract.LocalMessageTransmitter(&_TokenMessenger.CallOpts) +} + +// LocalMinter is a free data retrieval call binding the contract method 0xcb75c11c. +// +// Solidity: function localMinter() view returns(address) +func (_TokenMessenger *TokenMessengerCaller) LocalMinter(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "localMinter") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// LocalMinter is a free data retrieval call binding the contract method 0xcb75c11c. +// +// Solidity: function localMinter() view returns(address) +func (_TokenMessenger *TokenMessengerSession) LocalMinter() (common.Address, error) { + return _TokenMessenger.Contract.LocalMinter(&_TokenMessenger.CallOpts) +} + +// LocalMinter is a free data retrieval call binding the contract method 0xcb75c11c. +// +// Solidity: function localMinter() view returns(address) +func (_TokenMessenger *TokenMessengerCallerSession) LocalMinter() (common.Address, error) { + return _TokenMessenger.Contract.LocalMinter(&_TokenMessenger.CallOpts) +} + +// MessageBodyVersion is a free data retrieval call binding the contract method 0x9cdbb181. +// +// Solidity: function messageBodyVersion() view returns(uint32) +func (_TokenMessenger *TokenMessengerCaller) MessageBodyVersion(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "messageBodyVersion") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// MessageBodyVersion is a free data retrieval call binding the contract method 0x9cdbb181. +// +// Solidity: function messageBodyVersion() view returns(uint32) +func (_TokenMessenger *TokenMessengerSession) MessageBodyVersion() (uint32, error) { + return _TokenMessenger.Contract.MessageBodyVersion(&_TokenMessenger.CallOpts) +} + +// MessageBodyVersion is a free data retrieval call binding the contract method 0x9cdbb181. +// +// Solidity: function messageBodyVersion() view returns(uint32) +func (_TokenMessenger *TokenMessengerCallerSession) MessageBodyVersion() (uint32, error) { + return _TokenMessenger.Contract.MessageBodyVersion(&_TokenMessenger.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TokenMessenger *TokenMessengerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenMessenger.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 (_TokenMessenger *TokenMessengerSession) Owner() (common.Address, error) { + return _TokenMessenger.Contract.Owner(&_TokenMessenger.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_TokenMessenger *TokenMessengerCallerSession) Owner() (common.Address, error) { + return _TokenMessenger.Contract.Owner(&_TokenMessenger.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TokenMessenger *TokenMessengerCaller) PendingOwner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "pendingOwner") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TokenMessenger *TokenMessengerSession) PendingOwner() (common.Address, error) { + return _TokenMessenger.Contract.PendingOwner(&_TokenMessenger.CallOpts) +} + +// PendingOwner is a free data retrieval call binding the contract method 0xe30c3978. +// +// Solidity: function pendingOwner() view returns(address) +func (_TokenMessenger *TokenMessengerCallerSession) PendingOwner() (common.Address, error) { + return _TokenMessenger.Contract.PendingOwner(&_TokenMessenger.CallOpts) +} + +// RemoteTokenMessengers is a free data retrieval call binding the contract method 0x82a5e665. +// +// Solidity: function remoteTokenMessengers(uint32 ) view returns(bytes32) +func (_TokenMessenger *TokenMessengerCaller) RemoteTokenMessengers(opts *bind.CallOpts, arg0 uint32) ([32]byte, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "remoteTokenMessengers", arg0) + + if err != nil { + return *new([32]byte), err + } + + out0 := *abi.ConvertType(out[0], new([32]byte)).(*[32]byte) + + return out0, err + +} + +// RemoteTokenMessengers is a free data retrieval call binding the contract method 0x82a5e665. +// +// Solidity: function remoteTokenMessengers(uint32 ) view returns(bytes32) +func (_TokenMessenger *TokenMessengerSession) RemoteTokenMessengers(arg0 uint32) ([32]byte, error) { + return _TokenMessenger.Contract.RemoteTokenMessengers(&_TokenMessenger.CallOpts, arg0) +} + +// RemoteTokenMessengers is a free data retrieval call binding the contract method 0x82a5e665. +// +// Solidity: function remoteTokenMessengers(uint32 ) view returns(bytes32) +func (_TokenMessenger *TokenMessengerCallerSession) RemoteTokenMessengers(arg0 uint32) ([32]byte, error) { + return _TokenMessenger.Contract.RemoteTokenMessengers(&_TokenMessenger.CallOpts, arg0) +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_TokenMessenger *TokenMessengerCaller) Rescuer(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _TokenMessenger.contract.Call(opts, &out, "rescuer") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_TokenMessenger *TokenMessengerSession) Rescuer() (common.Address, error) { + return _TokenMessenger.Contract.Rescuer(&_TokenMessenger.CallOpts) +} + +// Rescuer is a free data retrieval call binding the contract method 0x38a63183. +// +// Solidity: function rescuer() view returns(address) +func (_TokenMessenger *TokenMessengerCallerSession) Rescuer() (common.Address, error) { + return _TokenMessenger.Contract.Rescuer(&_TokenMessenger.CallOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TokenMessenger *TokenMessengerTransactor) AcceptOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "acceptOwnership") +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TokenMessenger *TokenMessengerSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenMessenger.Contract.AcceptOwnership(&_TokenMessenger.TransactOpts) +} + +// AcceptOwnership is a paid mutator transaction binding the contract method 0x79ba5097. +// +// Solidity: function acceptOwnership() returns() +func (_TokenMessenger *TokenMessengerTransactorSession) AcceptOwnership() (*types.Transaction, error) { + return _TokenMessenger.Contract.AcceptOwnership(&_TokenMessenger.TransactOpts) +} + +// AddLocalMinter is a paid mutator transaction binding the contract method 0x8197beb9. +// +// Solidity: function addLocalMinter(address newLocalMinter) returns() +func (_TokenMessenger *TokenMessengerTransactor) AddLocalMinter(opts *bind.TransactOpts, newLocalMinter common.Address) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "addLocalMinter", newLocalMinter) +} + +// AddLocalMinter is a paid mutator transaction binding the contract method 0x8197beb9. +// +// Solidity: function addLocalMinter(address newLocalMinter) returns() +func (_TokenMessenger *TokenMessengerSession) AddLocalMinter(newLocalMinter common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.AddLocalMinter(&_TokenMessenger.TransactOpts, newLocalMinter) +} + +// AddLocalMinter is a paid mutator transaction binding the contract method 0x8197beb9. +// +// Solidity: function addLocalMinter(address newLocalMinter) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) AddLocalMinter(newLocalMinter common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.AddLocalMinter(&_TokenMessenger.TransactOpts, newLocalMinter) +} + +// AddRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xda87e448. +// +// Solidity: function addRemoteTokenMessenger(uint32 domain, bytes32 tokenMessenger) returns() +func (_TokenMessenger *TokenMessengerTransactor) AddRemoteTokenMessenger(opts *bind.TransactOpts, domain uint32, tokenMessenger [32]byte) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "addRemoteTokenMessenger", domain, tokenMessenger) +} + +// AddRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xda87e448. +// +// Solidity: function addRemoteTokenMessenger(uint32 domain, bytes32 tokenMessenger) returns() +func (_TokenMessenger *TokenMessengerSession) AddRemoteTokenMessenger(domain uint32, tokenMessenger [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.AddRemoteTokenMessenger(&_TokenMessenger.TransactOpts, domain, tokenMessenger) +} + +// AddRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xda87e448. +// +// Solidity: function addRemoteTokenMessenger(uint32 domain, bytes32 tokenMessenger) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) AddRemoteTokenMessenger(domain uint32, tokenMessenger [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.AddRemoteTokenMessenger(&_TokenMessenger.TransactOpts, domain, tokenMessenger) +} + +// DepositForBurn is a paid mutator transaction binding the contract method 0x6fd3504e. +// +// Solidity: function depositForBurn(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken) returns(uint64 _nonce) +func (_TokenMessenger *TokenMessengerTransactor) DepositForBurn(opts *bind.TransactOpts, amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "depositForBurn", amount, destinationDomain, mintRecipient, burnToken) +} + +// DepositForBurn is a paid mutator transaction binding the contract method 0x6fd3504e. +// +// Solidity: function depositForBurn(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken) returns(uint64 _nonce) +func (_TokenMessenger *TokenMessengerSession) DepositForBurn(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.DepositForBurn(&_TokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken) +} + +// DepositForBurn is a paid mutator transaction binding the contract method 0x6fd3504e. +// +// Solidity: function depositForBurn(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken) returns(uint64 _nonce) +func (_TokenMessenger *TokenMessengerTransactorSession) DepositForBurn(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.DepositForBurn(&_TokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken) +} + +// DepositForBurnWithCaller is a paid mutator transaction binding the contract method 0xf856ddb6. +// +// Solidity: function depositForBurnWithCaller(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, bytes32 destinationCaller) returns(uint64 nonce) +func (_TokenMessenger *TokenMessengerTransactor) DepositForBurnWithCaller(opts *bind.TransactOpts, amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "depositForBurnWithCaller", amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +// DepositForBurnWithCaller is a paid mutator transaction binding the contract method 0xf856ddb6. +// +// Solidity: function depositForBurnWithCaller(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, bytes32 destinationCaller) returns(uint64 nonce) +func (_TokenMessenger *TokenMessengerSession) DepositForBurnWithCaller(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.DepositForBurnWithCaller(&_TokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +// DepositForBurnWithCaller is a paid mutator transaction binding the contract method 0xf856ddb6. +// +// Solidity: function depositForBurnWithCaller(uint256 amount, uint32 destinationDomain, bytes32 mintRecipient, address burnToken, bytes32 destinationCaller) returns(uint64 nonce) +func (_TokenMessenger *TokenMessengerTransactorSession) DepositForBurnWithCaller(amount *big.Int, destinationDomain uint32, mintRecipient [32]byte, burnToken common.Address, destinationCaller [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.DepositForBurnWithCaller(&_TokenMessenger.TransactOpts, amount, destinationDomain, mintRecipient, burnToken, destinationCaller) +} + +// HandleReceiveMessage is a paid mutator transaction binding the contract method 0x96abeb70. +// +// Solidity: function handleReceiveMessage(uint32 remoteDomain, bytes32 sender, bytes messageBody) returns(bool) +func (_TokenMessenger *TokenMessengerTransactor) HandleReceiveMessage(opts *bind.TransactOpts, remoteDomain uint32, sender [32]byte, messageBody []byte) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "handleReceiveMessage", remoteDomain, sender, messageBody) +} + +// HandleReceiveMessage is a paid mutator transaction binding the contract method 0x96abeb70. +// +// Solidity: function handleReceiveMessage(uint32 remoteDomain, bytes32 sender, bytes messageBody) returns(bool) +func (_TokenMessenger *TokenMessengerSession) HandleReceiveMessage(remoteDomain uint32, sender [32]byte, messageBody []byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.HandleReceiveMessage(&_TokenMessenger.TransactOpts, remoteDomain, sender, messageBody) +} + +// HandleReceiveMessage is a paid mutator transaction binding the contract method 0x96abeb70. +// +// Solidity: function handleReceiveMessage(uint32 remoteDomain, bytes32 sender, bytes messageBody) returns(bool) +func (_TokenMessenger *TokenMessengerTransactorSession) HandleReceiveMessage(remoteDomain uint32, sender [32]byte, messageBody []byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.HandleReceiveMessage(&_TokenMessenger.TransactOpts, remoteDomain, sender, messageBody) +} + +// RemoveLocalMinter is a paid mutator transaction binding the contract method 0x91f17888. +// +// Solidity: function removeLocalMinter() returns() +func (_TokenMessenger *TokenMessengerTransactor) RemoveLocalMinter(opts *bind.TransactOpts) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "removeLocalMinter") +} + +// RemoveLocalMinter is a paid mutator transaction binding the contract method 0x91f17888. +// +// Solidity: function removeLocalMinter() returns() +func (_TokenMessenger *TokenMessengerSession) RemoveLocalMinter() (*types.Transaction, error) { + return _TokenMessenger.Contract.RemoveLocalMinter(&_TokenMessenger.TransactOpts) +} + +// RemoveLocalMinter is a paid mutator transaction binding the contract method 0x91f17888. +// +// Solidity: function removeLocalMinter() returns() +func (_TokenMessenger *TokenMessengerTransactorSession) RemoveLocalMinter() (*types.Transaction, error) { + return _TokenMessenger.Contract.RemoveLocalMinter(&_TokenMessenger.TransactOpts) +} + +// RemoveRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xf79fd08e. +// +// Solidity: function removeRemoteTokenMessenger(uint32 domain) returns() +func (_TokenMessenger *TokenMessengerTransactor) RemoveRemoteTokenMessenger(opts *bind.TransactOpts, domain uint32) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "removeRemoteTokenMessenger", domain) +} + +// RemoveRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xf79fd08e. +// +// Solidity: function removeRemoteTokenMessenger(uint32 domain) returns() +func (_TokenMessenger *TokenMessengerSession) RemoveRemoteTokenMessenger(domain uint32) (*types.Transaction, error) { + return _TokenMessenger.Contract.RemoveRemoteTokenMessenger(&_TokenMessenger.TransactOpts, domain) +} + +// RemoveRemoteTokenMessenger is a paid mutator transaction binding the contract method 0xf79fd08e. +// +// Solidity: function removeRemoteTokenMessenger(uint32 domain) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) RemoveRemoteTokenMessenger(domain uint32) (*types.Transaction, error) { + return _TokenMessenger.Contract.RemoveRemoteTokenMessenger(&_TokenMessenger.TransactOpts, domain) +} + +// ReplaceDepositForBurn is a paid mutator transaction binding the contract method 0x29a78e33. +// +// Solidity: function replaceDepositForBurn(bytes originalMessage, bytes originalAttestation, bytes32 newDestinationCaller, bytes32 newMintRecipient) returns() +func (_TokenMessenger *TokenMessengerTransactor) ReplaceDepositForBurn(opts *bind.TransactOpts, originalMessage []byte, originalAttestation []byte, newDestinationCaller [32]byte, newMintRecipient [32]byte) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "replaceDepositForBurn", originalMessage, originalAttestation, newDestinationCaller, newMintRecipient) +} + +// ReplaceDepositForBurn is a paid mutator transaction binding the contract method 0x29a78e33. +// +// Solidity: function replaceDepositForBurn(bytes originalMessage, bytes originalAttestation, bytes32 newDestinationCaller, bytes32 newMintRecipient) returns() +func (_TokenMessenger *TokenMessengerSession) ReplaceDepositForBurn(originalMessage []byte, originalAttestation []byte, newDestinationCaller [32]byte, newMintRecipient [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.ReplaceDepositForBurn(&_TokenMessenger.TransactOpts, originalMessage, originalAttestation, newDestinationCaller, newMintRecipient) +} + +// ReplaceDepositForBurn is a paid mutator transaction binding the contract method 0x29a78e33. +// +// Solidity: function replaceDepositForBurn(bytes originalMessage, bytes originalAttestation, bytes32 newDestinationCaller, bytes32 newMintRecipient) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) ReplaceDepositForBurn(originalMessage []byte, originalAttestation []byte, newDestinationCaller [32]byte, newMintRecipient [32]byte) (*types.Transaction, error) { + return _TokenMessenger.Contract.ReplaceDepositForBurn(&_TokenMessenger.TransactOpts, originalMessage, originalAttestation, newDestinationCaller, newMintRecipient) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_TokenMessenger *TokenMessengerTransactor) RescueERC20(opts *bind.TransactOpts, tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "rescueERC20", tokenContract, to, amount) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_TokenMessenger *TokenMessengerSession) RescueERC20(tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TokenMessenger.Contract.RescueERC20(&_TokenMessenger.TransactOpts, tokenContract, to, amount) +} + +// RescueERC20 is a paid mutator transaction binding the contract method 0xb2118a8d. +// +// Solidity: function rescueERC20(address tokenContract, address to, uint256 amount) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) RescueERC20(tokenContract common.Address, to common.Address, amount *big.Int) (*types.Transaction, error) { + return _TokenMessenger.Contract.RescueERC20(&_TokenMessenger.TransactOpts, tokenContract, to, amount) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TokenMessenger *TokenMessengerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TokenMessenger *TokenMessengerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.TransferOwnership(&_TokenMessenger.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.TransferOwnership(&_TokenMessenger.TransactOpts, newOwner) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_TokenMessenger *TokenMessengerTransactor) UpdateRescuer(opts *bind.TransactOpts, newRescuer common.Address) (*types.Transaction, error) { + return _TokenMessenger.contract.Transact(opts, "updateRescuer", newRescuer) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_TokenMessenger *TokenMessengerSession) UpdateRescuer(newRescuer common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.UpdateRescuer(&_TokenMessenger.TransactOpts, newRescuer) +} + +// UpdateRescuer is a paid mutator transaction binding the contract method 0x2ab60045. +// +// Solidity: function updateRescuer(address newRescuer) returns() +func (_TokenMessenger *TokenMessengerTransactorSession) UpdateRescuer(newRescuer common.Address) (*types.Transaction, error) { + return _TokenMessenger.Contract.UpdateRescuer(&_TokenMessenger.TransactOpts, newRescuer) +} + +// TokenMessengerDepositForBurnIterator is returned from FilterDepositForBurn and is used to iterate over the raw logs and unpacked data for DepositForBurn events raised by the TokenMessenger contract. +type TokenMessengerDepositForBurnIterator struct { + Event *TokenMessengerDepositForBurn // 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 *TokenMessengerDepositForBurnIterator) 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(TokenMessengerDepositForBurn) + 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(TokenMessengerDepositForBurn) + 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 *TokenMessengerDepositForBurnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerDepositForBurnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerDepositForBurn represents a DepositForBurn event raised by the TokenMessenger contract. +type TokenMessengerDepositForBurn struct { + Nonce uint64 + BurnToken common.Address + Amount *big.Int + Depositor common.Address + MintRecipient [32]byte + DestinationDomain uint32 + DestinationTokenMessenger [32]byte + DestinationCaller [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterDepositForBurn is a free log retrieval operation binding the contract event 0x2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c0. +// +// Solidity: event DepositForBurn(uint64 indexed nonce, address indexed burnToken, uint256 amount, address indexed depositor, bytes32 mintRecipient, uint32 destinationDomain, bytes32 destinationTokenMessenger, bytes32 destinationCaller) +func (_TokenMessenger *TokenMessengerFilterer) FilterDepositForBurn(opts *bind.FilterOpts, nonce []uint64, burnToken []common.Address, depositor []common.Address) (*TokenMessengerDepositForBurnIterator, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var burnTokenRule []interface{} + for _, burnTokenItem := range burnToken { + burnTokenRule = append(burnTokenRule, burnTokenItem) + } + + var depositorRule []interface{} + for _, depositorItem := range depositor { + depositorRule = append(depositorRule, depositorItem) + } + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "DepositForBurn", nonceRule, burnTokenRule, depositorRule) + if err != nil { + return nil, err + } + return &TokenMessengerDepositForBurnIterator{contract: _TokenMessenger.contract, event: "DepositForBurn", logs: logs, sub: sub}, nil +} + +// WatchDepositForBurn is a free log subscription operation binding the contract event 0x2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c0. +// +// Solidity: event DepositForBurn(uint64 indexed nonce, address indexed burnToken, uint256 amount, address indexed depositor, bytes32 mintRecipient, uint32 destinationDomain, bytes32 destinationTokenMessenger, bytes32 destinationCaller) +func (_TokenMessenger *TokenMessengerFilterer) WatchDepositForBurn(opts *bind.WatchOpts, sink chan<- *TokenMessengerDepositForBurn, nonce []uint64, burnToken []common.Address, depositor []common.Address) (event.Subscription, error) { + + var nonceRule []interface{} + for _, nonceItem := range nonce { + nonceRule = append(nonceRule, nonceItem) + } + var burnTokenRule []interface{} + for _, burnTokenItem := range burnToken { + burnTokenRule = append(burnTokenRule, burnTokenItem) + } + + var depositorRule []interface{} + for _, depositorItem := range depositor { + depositorRule = append(depositorRule, depositorItem) + } + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "DepositForBurn", nonceRule, burnTokenRule, depositorRule) + 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(TokenMessengerDepositForBurn) + if err := _TokenMessenger.contract.UnpackLog(event, "DepositForBurn", 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 +} + +// ParseDepositForBurn is a log parse operation binding the contract event 0x2fa9ca894982930190727e75500a97d8dc500233a5065e0f3126c48fbe0343c0. +// +// Solidity: event DepositForBurn(uint64 indexed nonce, address indexed burnToken, uint256 amount, address indexed depositor, bytes32 mintRecipient, uint32 destinationDomain, bytes32 destinationTokenMessenger, bytes32 destinationCaller) +func (_TokenMessenger *TokenMessengerFilterer) ParseDepositForBurn(log types.Log) (*TokenMessengerDepositForBurn, error) { + event := new(TokenMessengerDepositForBurn) + if err := _TokenMessenger.contract.UnpackLog(event, "DepositForBurn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerLocalMinterAddedIterator is returned from FilterLocalMinterAdded and is used to iterate over the raw logs and unpacked data for LocalMinterAdded events raised by the TokenMessenger contract. +type TokenMessengerLocalMinterAddedIterator struct { + Event *TokenMessengerLocalMinterAdded // 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 *TokenMessengerLocalMinterAddedIterator) 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(TokenMessengerLocalMinterAdded) + 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(TokenMessengerLocalMinterAdded) + 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 *TokenMessengerLocalMinterAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerLocalMinterAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerLocalMinterAdded represents a LocalMinterAdded event raised by the TokenMessenger contract. +type TokenMessengerLocalMinterAdded struct { + LocalMinter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLocalMinterAdded is a free log retrieval operation binding the contract event 0x109bb3e70cbf1931e295b49e75c67013b85ff80d64e6f1d321f37157b90c3830. +// +// Solidity: event LocalMinterAdded(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) FilterLocalMinterAdded(opts *bind.FilterOpts) (*TokenMessengerLocalMinterAddedIterator, error) { + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "LocalMinterAdded") + if err != nil { + return nil, err + } + return &TokenMessengerLocalMinterAddedIterator{contract: _TokenMessenger.contract, event: "LocalMinterAdded", logs: logs, sub: sub}, nil +} + +// WatchLocalMinterAdded is a free log subscription operation binding the contract event 0x109bb3e70cbf1931e295b49e75c67013b85ff80d64e6f1d321f37157b90c3830. +// +// Solidity: event LocalMinterAdded(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) WatchLocalMinterAdded(opts *bind.WatchOpts, sink chan<- *TokenMessengerLocalMinterAdded) (event.Subscription, error) { + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "LocalMinterAdded") + 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(TokenMessengerLocalMinterAdded) + if err := _TokenMessenger.contract.UnpackLog(event, "LocalMinterAdded", 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 +} + +// ParseLocalMinterAdded is a log parse operation binding the contract event 0x109bb3e70cbf1931e295b49e75c67013b85ff80d64e6f1d321f37157b90c3830. +// +// Solidity: event LocalMinterAdded(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) ParseLocalMinterAdded(log types.Log) (*TokenMessengerLocalMinterAdded, error) { + event := new(TokenMessengerLocalMinterAdded) + if err := _TokenMessenger.contract.UnpackLog(event, "LocalMinterAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerLocalMinterRemovedIterator is returned from FilterLocalMinterRemoved and is used to iterate over the raw logs and unpacked data for LocalMinterRemoved events raised by the TokenMessenger contract. +type TokenMessengerLocalMinterRemovedIterator struct { + Event *TokenMessengerLocalMinterRemoved // 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 *TokenMessengerLocalMinterRemovedIterator) 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(TokenMessengerLocalMinterRemoved) + 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(TokenMessengerLocalMinterRemoved) + 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 *TokenMessengerLocalMinterRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerLocalMinterRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerLocalMinterRemoved represents a LocalMinterRemoved event raised by the TokenMessenger contract. +type TokenMessengerLocalMinterRemoved struct { + LocalMinter common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterLocalMinterRemoved is a free log retrieval operation binding the contract event 0x2db49fbf671271826a27b02ebc496209c85fffffb4bccc67430d2a0f22b4d1ac. +// +// Solidity: event LocalMinterRemoved(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) FilterLocalMinterRemoved(opts *bind.FilterOpts) (*TokenMessengerLocalMinterRemovedIterator, error) { + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "LocalMinterRemoved") + if err != nil { + return nil, err + } + return &TokenMessengerLocalMinterRemovedIterator{contract: _TokenMessenger.contract, event: "LocalMinterRemoved", logs: logs, sub: sub}, nil +} + +// WatchLocalMinterRemoved is a free log subscription operation binding the contract event 0x2db49fbf671271826a27b02ebc496209c85fffffb4bccc67430d2a0f22b4d1ac. +// +// Solidity: event LocalMinterRemoved(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) WatchLocalMinterRemoved(opts *bind.WatchOpts, sink chan<- *TokenMessengerLocalMinterRemoved) (event.Subscription, error) { + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "LocalMinterRemoved") + 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(TokenMessengerLocalMinterRemoved) + if err := _TokenMessenger.contract.UnpackLog(event, "LocalMinterRemoved", 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 +} + +// ParseLocalMinterRemoved is a log parse operation binding the contract event 0x2db49fbf671271826a27b02ebc496209c85fffffb4bccc67430d2a0f22b4d1ac. +// +// Solidity: event LocalMinterRemoved(address localMinter) +func (_TokenMessenger *TokenMessengerFilterer) ParseLocalMinterRemoved(log types.Log) (*TokenMessengerLocalMinterRemoved, error) { + event := new(TokenMessengerLocalMinterRemoved) + if err := _TokenMessenger.contract.UnpackLog(event, "LocalMinterRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerMintAndWithdrawIterator is returned from FilterMintAndWithdraw and is used to iterate over the raw logs and unpacked data for MintAndWithdraw events raised by the TokenMessenger contract. +type TokenMessengerMintAndWithdrawIterator struct { + Event *TokenMessengerMintAndWithdraw // 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 *TokenMessengerMintAndWithdrawIterator) 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(TokenMessengerMintAndWithdraw) + 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(TokenMessengerMintAndWithdraw) + 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 *TokenMessengerMintAndWithdrawIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerMintAndWithdrawIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerMintAndWithdraw represents a MintAndWithdraw event raised by the TokenMessenger contract. +type TokenMessengerMintAndWithdraw struct { + MintRecipient common.Address + Amount *big.Int + MintToken common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterMintAndWithdraw is a free log retrieval operation binding the contract event 0x1b2a7ff080b8cb6ff436ce0372e399692bbfb6d4ae5766fd8d58a7b8cc6142e6. +// +// Solidity: event MintAndWithdraw(address indexed mintRecipient, uint256 amount, address indexed mintToken) +func (_TokenMessenger *TokenMessengerFilterer) FilterMintAndWithdraw(opts *bind.FilterOpts, mintRecipient []common.Address, mintToken []common.Address) (*TokenMessengerMintAndWithdrawIterator, error) { + + var mintRecipientRule []interface{} + for _, mintRecipientItem := range mintRecipient { + mintRecipientRule = append(mintRecipientRule, mintRecipientItem) + } + + var mintTokenRule []interface{} + for _, mintTokenItem := range mintToken { + mintTokenRule = append(mintTokenRule, mintTokenItem) + } + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "MintAndWithdraw", mintRecipientRule, mintTokenRule) + if err != nil { + return nil, err + } + return &TokenMessengerMintAndWithdrawIterator{contract: _TokenMessenger.contract, event: "MintAndWithdraw", logs: logs, sub: sub}, nil +} + +// WatchMintAndWithdraw is a free log subscription operation binding the contract event 0x1b2a7ff080b8cb6ff436ce0372e399692bbfb6d4ae5766fd8d58a7b8cc6142e6. +// +// Solidity: event MintAndWithdraw(address indexed mintRecipient, uint256 amount, address indexed mintToken) +func (_TokenMessenger *TokenMessengerFilterer) WatchMintAndWithdraw(opts *bind.WatchOpts, sink chan<- *TokenMessengerMintAndWithdraw, mintRecipient []common.Address, mintToken []common.Address) (event.Subscription, error) { + + var mintRecipientRule []interface{} + for _, mintRecipientItem := range mintRecipient { + mintRecipientRule = append(mintRecipientRule, mintRecipientItem) + } + + var mintTokenRule []interface{} + for _, mintTokenItem := range mintToken { + mintTokenRule = append(mintTokenRule, mintTokenItem) + } + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "MintAndWithdraw", mintRecipientRule, mintTokenRule) + 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(TokenMessengerMintAndWithdraw) + if err := _TokenMessenger.contract.UnpackLog(event, "MintAndWithdraw", 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 +} + +// ParseMintAndWithdraw is a log parse operation binding the contract event 0x1b2a7ff080b8cb6ff436ce0372e399692bbfb6d4ae5766fd8d58a7b8cc6142e6. +// +// Solidity: event MintAndWithdraw(address indexed mintRecipient, uint256 amount, address indexed mintToken) +func (_TokenMessenger *TokenMessengerFilterer) ParseMintAndWithdraw(log types.Log) (*TokenMessengerMintAndWithdraw, error) { + event := new(TokenMessengerMintAndWithdraw) + if err := _TokenMessenger.contract.UnpackLog(event, "MintAndWithdraw", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerOwnershipTransferStartedIterator is returned from FilterOwnershipTransferStarted and is used to iterate over the raw logs and unpacked data for OwnershipTransferStarted events raised by the TokenMessenger contract. +type TokenMessengerOwnershipTransferStartedIterator struct { + Event *TokenMessengerOwnershipTransferStarted // 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 *TokenMessengerOwnershipTransferStartedIterator) 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(TokenMessengerOwnershipTransferStarted) + 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(TokenMessengerOwnershipTransferStarted) + 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 *TokenMessengerOwnershipTransferStartedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerOwnershipTransferStartedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerOwnershipTransferStarted represents a OwnershipTransferStarted event raised by the TokenMessenger contract. +type TokenMessengerOwnershipTransferStarted struct { + PreviousOwner common.Address + NewOwner common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterOwnershipTransferStarted is a free log retrieval operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TokenMessenger *TokenMessengerFilterer) FilterOwnershipTransferStarted(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TokenMessengerOwnershipTransferStartedIterator, 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 := _TokenMessenger.contract.FilterLogs(opts, "OwnershipTransferStarted", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TokenMessengerOwnershipTransferStartedIterator{contract: _TokenMessenger.contract, event: "OwnershipTransferStarted", logs: logs, sub: sub}, nil +} + +// WatchOwnershipTransferStarted is a free log subscription operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TokenMessenger *TokenMessengerFilterer) WatchOwnershipTransferStarted(opts *bind.WatchOpts, sink chan<- *TokenMessengerOwnershipTransferStarted, 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 := _TokenMessenger.contract.WatchLogs(opts, "OwnershipTransferStarted", 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(TokenMessengerOwnershipTransferStarted) + if err := _TokenMessenger.contract.UnpackLog(event, "OwnershipTransferStarted", 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 +} + +// ParseOwnershipTransferStarted is a log parse operation binding the contract event 0x38d16b8cac22d99fc7c124b9cd0de2d3fa1faef420bfe791d8c362d765e22700. +// +// Solidity: event OwnershipTransferStarted(address indexed previousOwner, address indexed newOwner) +func (_TokenMessenger *TokenMessengerFilterer) ParseOwnershipTransferStarted(log types.Log) (*TokenMessengerOwnershipTransferStarted, error) { + event := new(TokenMessengerOwnershipTransferStarted) + if err := _TokenMessenger.contract.UnpackLog(event, "OwnershipTransferStarted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the TokenMessenger contract. +type TokenMessengerOwnershipTransferredIterator struct { + Event *TokenMessengerOwnershipTransferred // 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 *TokenMessengerOwnershipTransferredIterator) 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(TokenMessengerOwnershipTransferred) + 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(TokenMessengerOwnershipTransferred) + 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 *TokenMessengerOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerOwnershipTransferred represents a OwnershipTransferred event raised by the TokenMessenger contract. +type TokenMessengerOwnershipTransferred 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 (_TokenMessenger *TokenMessengerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*TokenMessengerOwnershipTransferredIterator, 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 := _TokenMessenger.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &TokenMessengerOwnershipTransferredIterator{contract: _TokenMessenger.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 (_TokenMessenger *TokenMessengerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *TokenMessengerOwnershipTransferred, 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 := _TokenMessenger.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(TokenMessengerOwnershipTransferred) + if err := _TokenMessenger.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 (_TokenMessenger *TokenMessengerFilterer) ParseOwnershipTransferred(log types.Log) (*TokenMessengerOwnershipTransferred, error) { + event := new(TokenMessengerOwnershipTransferred) + if err := _TokenMessenger.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerRemoteTokenMessengerAddedIterator is returned from FilterRemoteTokenMessengerAdded and is used to iterate over the raw logs and unpacked data for RemoteTokenMessengerAdded events raised by the TokenMessenger contract. +type TokenMessengerRemoteTokenMessengerAddedIterator struct { + Event *TokenMessengerRemoteTokenMessengerAdded // 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 *TokenMessengerRemoteTokenMessengerAddedIterator) 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(TokenMessengerRemoteTokenMessengerAdded) + 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(TokenMessengerRemoteTokenMessengerAdded) + 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 *TokenMessengerRemoteTokenMessengerAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerRemoteTokenMessengerAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerRemoteTokenMessengerAdded represents a RemoteTokenMessengerAdded event raised by the TokenMessenger contract. +type TokenMessengerRemoteTokenMessengerAdded struct { + Domain uint32 + TokenMessenger [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemoteTokenMessengerAdded is a free log retrieval operation binding the contract event 0x4bba2b08298cf59661b4895e384cc2ac3962ce2d71f1b7c11bca52e1169f9599. +// +// Solidity: event RemoteTokenMessengerAdded(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) FilterRemoteTokenMessengerAdded(opts *bind.FilterOpts) (*TokenMessengerRemoteTokenMessengerAddedIterator, error) { + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "RemoteTokenMessengerAdded") + if err != nil { + return nil, err + } + return &TokenMessengerRemoteTokenMessengerAddedIterator{contract: _TokenMessenger.contract, event: "RemoteTokenMessengerAdded", logs: logs, sub: sub}, nil +} + +// WatchRemoteTokenMessengerAdded is a free log subscription operation binding the contract event 0x4bba2b08298cf59661b4895e384cc2ac3962ce2d71f1b7c11bca52e1169f9599. +// +// Solidity: event RemoteTokenMessengerAdded(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) WatchRemoteTokenMessengerAdded(opts *bind.WatchOpts, sink chan<- *TokenMessengerRemoteTokenMessengerAdded) (event.Subscription, error) { + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "RemoteTokenMessengerAdded") + 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(TokenMessengerRemoteTokenMessengerAdded) + if err := _TokenMessenger.contract.UnpackLog(event, "RemoteTokenMessengerAdded", 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 +} + +// ParseRemoteTokenMessengerAdded is a log parse operation binding the contract event 0x4bba2b08298cf59661b4895e384cc2ac3962ce2d71f1b7c11bca52e1169f9599. +// +// Solidity: event RemoteTokenMessengerAdded(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) ParseRemoteTokenMessengerAdded(log types.Log) (*TokenMessengerRemoteTokenMessengerAdded, error) { + event := new(TokenMessengerRemoteTokenMessengerAdded) + if err := _TokenMessenger.contract.UnpackLog(event, "RemoteTokenMessengerAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerRemoteTokenMessengerRemovedIterator is returned from FilterRemoteTokenMessengerRemoved and is used to iterate over the raw logs and unpacked data for RemoteTokenMessengerRemoved events raised by the TokenMessenger contract. +type TokenMessengerRemoteTokenMessengerRemovedIterator struct { + Event *TokenMessengerRemoteTokenMessengerRemoved // 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 *TokenMessengerRemoteTokenMessengerRemovedIterator) 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(TokenMessengerRemoteTokenMessengerRemoved) + 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(TokenMessengerRemoteTokenMessengerRemoved) + 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 *TokenMessengerRemoteTokenMessengerRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerRemoteTokenMessengerRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerRemoteTokenMessengerRemoved represents a RemoteTokenMessengerRemoved event raised by the TokenMessenger contract. +type TokenMessengerRemoteTokenMessengerRemoved struct { + Domain uint32 + TokenMessenger [32]byte + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRemoteTokenMessengerRemoved is a free log retrieval operation binding the contract event 0x3dcea012093dbca2bb8ed7fd2b2ff90305ab70bddda8bbb94d4152735a98f0b1. +// +// Solidity: event RemoteTokenMessengerRemoved(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) FilterRemoteTokenMessengerRemoved(opts *bind.FilterOpts) (*TokenMessengerRemoteTokenMessengerRemovedIterator, error) { + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "RemoteTokenMessengerRemoved") + if err != nil { + return nil, err + } + return &TokenMessengerRemoteTokenMessengerRemovedIterator{contract: _TokenMessenger.contract, event: "RemoteTokenMessengerRemoved", logs: logs, sub: sub}, nil +} + +// WatchRemoteTokenMessengerRemoved is a free log subscription operation binding the contract event 0x3dcea012093dbca2bb8ed7fd2b2ff90305ab70bddda8bbb94d4152735a98f0b1. +// +// Solidity: event RemoteTokenMessengerRemoved(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) WatchRemoteTokenMessengerRemoved(opts *bind.WatchOpts, sink chan<- *TokenMessengerRemoteTokenMessengerRemoved) (event.Subscription, error) { + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "RemoteTokenMessengerRemoved") + 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(TokenMessengerRemoteTokenMessengerRemoved) + if err := _TokenMessenger.contract.UnpackLog(event, "RemoteTokenMessengerRemoved", 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 +} + +// ParseRemoteTokenMessengerRemoved is a log parse operation binding the contract event 0x3dcea012093dbca2bb8ed7fd2b2ff90305ab70bddda8bbb94d4152735a98f0b1. +// +// Solidity: event RemoteTokenMessengerRemoved(uint32 domain, bytes32 tokenMessenger) +func (_TokenMessenger *TokenMessengerFilterer) ParseRemoteTokenMessengerRemoved(log types.Log) (*TokenMessengerRemoteTokenMessengerRemoved, error) { + event := new(TokenMessengerRemoteTokenMessengerRemoved) + if err := _TokenMessenger.contract.UnpackLog(event, "RemoteTokenMessengerRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// TokenMessengerRescuerChangedIterator is returned from FilterRescuerChanged and is used to iterate over the raw logs and unpacked data for RescuerChanged events raised by the TokenMessenger contract. +type TokenMessengerRescuerChangedIterator struct { + Event *TokenMessengerRescuerChanged // 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 *TokenMessengerRescuerChangedIterator) 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(TokenMessengerRescuerChanged) + 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(TokenMessengerRescuerChanged) + 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 *TokenMessengerRescuerChangedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *TokenMessengerRescuerChangedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// TokenMessengerRescuerChanged represents a RescuerChanged event raised by the TokenMessenger contract. +type TokenMessengerRescuerChanged struct { + NewRescuer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRescuerChanged is a free log retrieval operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_TokenMessenger *TokenMessengerFilterer) FilterRescuerChanged(opts *bind.FilterOpts, newRescuer []common.Address) (*TokenMessengerRescuerChangedIterator, error) { + + var newRescuerRule []interface{} + for _, newRescuerItem := range newRescuer { + newRescuerRule = append(newRescuerRule, newRescuerItem) + } + + logs, sub, err := _TokenMessenger.contract.FilterLogs(opts, "RescuerChanged", newRescuerRule) + if err != nil { + return nil, err + } + return &TokenMessengerRescuerChangedIterator{contract: _TokenMessenger.contract, event: "RescuerChanged", logs: logs, sub: sub}, nil +} + +// WatchRescuerChanged is a free log subscription operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_TokenMessenger *TokenMessengerFilterer) WatchRescuerChanged(opts *bind.WatchOpts, sink chan<- *TokenMessengerRescuerChanged, newRescuer []common.Address) (event.Subscription, error) { + + var newRescuerRule []interface{} + for _, newRescuerItem := range newRescuer { + newRescuerRule = append(newRescuerRule, newRescuerItem) + } + + logs, sub, err := _TokenMessenger.contract.WatchLogs(opts, "RescuerChanged", newRescuerRule) + 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(TokenMessengerRescuerChanged) + if err := _TokenMessenger.contract.UnpackLog(event, "RescuerChanged", 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 +} + +// ParseRescuerChanged is a log parse operation binding the contract event 0xe475e580d85111348e40d8ca33cfdd74c30fe1655c2d8537a13abc10065ffa5a. +// +// Solidity: event RescuerChanged(address indexed newRescuer) +func (_TokenMessenger *TokenMessengerFilterer) ParseRescuerChanged(log types.Log) (*TokenMessengerRescuerChanged, error) { + event := new(TokenMessengerRescuerChanged) + if err := _TokenMessenger.contract.UnpackLog(event, "RescuerChanged", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/dex/networks/erc20/cctp/TokenMessenger.json b/dex/networks/erc20/cctp/TokenMessenger.json new file mode 100644 index 0000000000..f87bc9cbd3 --- /dev/null +++ b/dex/networks/erc20/cctp/TokenMessenger.json @@ -0,0 +1,547 @@ +[ + { + "inputs": [ + { + "internalType": "address", + "name": "_messageTransmitter", + "type": "address" + }, + { + "internalType": "uint32", + "name": "_messageBodyVersion", + "type": "uint32" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + }, + { + "indexed": true, + "internalType": "address", + "name": "burnToken", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "depositor", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "destinationTokenMessenger", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "destinationCaller", + "type": "bytes32" + } + ], + "name": "DepositForBurn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "localMinter", + "type": "address" + } + ], + "name": "LocalMinterAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "localMinter", + "type": "address" + } + ], + "name": "LocalMinterRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "mintRecipient", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "mintToken", + "type": "address" + } + ], + "name": "MintAndWithdraw", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "RemoteTokenMessengerAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "RemoteTokenMessengerRemoved", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "RescuerChanged", + "type": "event" + }, + { + "inputs": [], + "name": "acceptOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newLocalMinter", + "type": "address" + } + ], + "name": "addLocalMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "domain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "tokenMessenger", + "type": "bytes32" + } + ], + "name": "addRemoteTokenMessenger", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "burnToken", + "type": "address" + } + ], + "name": "depositForBurn", + "outputs": [ + { + "internalType": "uint64", + "name": "_nonce", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "destinationDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "mintRecipient", + "type": "bytes32" + }, + { + "internalType": "address", + "name": "burnToken", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "destinationCaller", + "type": "bytes32" + } + ], + "name": "depositForBurnWithCaller", + "outputs": [ + { + "internalType": "uint64", + "name": "nonce", + "type": "uint64" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "remoteDomain", + "type": "uint32" + }, + { + "internalType": "bytes32", + "name": "sender", + "type": "bytes32" + }, + { + "internalType": "bytes", + "name": "messageBody", + "type": "bytes" + } + ], + "name": "handleReceiveMessage", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "localMessageTransmitter", + "outputs": [ + { + "internalType": "contract IMessageTransmitter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "localMinter", + "outputs": [ + { + "internalType": "contract ITokenMinter", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "messageBodyVersion", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pendingOwner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "name": "remoteTokenMessengers", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "removeLocalMinter", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "domain", + "type": "uint32" + } + ], + "name": "removeRemoteTokenMessenger", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "originalMessage", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "originalAttestation", + "type": "bytes" + }, + { + "internalType": "bytes32", + "name": "newDestinationCaller", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "newMintRecipient", + "type": "bytes32" + } + ], + "name": "replaceDepositForBurn", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IERC20", + "name": "tokenContract", + "type": "address" + }, + { + "internalType": "address", + "name": "to", + "type": "address" + }, + { + "internalType": "uint256", + "name": "amount", + "type": "uint256" + } + ], + "name": "rescueERC20", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "rescuer", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newRescuer", + "type": "address" + } + ], + "name": "updateRescuer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } + ] \ No newline at end of file diff --git a/dex/networks/erc20/cctp/genfiles.sh b/dex/networks/erc20/cctp/genfiles.sh new file mode 100644 index 0000000000..0411d1de1c --- /dev/null +++ b/dex/networks/erc20/cctp/genfiles.sh @@ -0,0 +1,2 @@ +abigen -abi ./TokenMessenger.json -pkg cctp -type TokenMessenger -out TokenMessenger.go +abigen -abi ./MessageTransmitter.json -pkg cctp -type MessageTransmitter -out MessageTransmitter.go