diff --git a/pkg/chain/ethereum/tbtc/gen/Makefile b/pkg/chain/ethereum/tbtc/gen/Makefile index d9d72d0073..3e24c0b6d7 100644 --- a/pkg/chain/ethereum/tbtc/gen/Makefile +++ b/pkg/chain/ethereum/tbtc/gen/Makefile @@ -1,7 +1,7 @@ npm_package_name=@keep-network/tbtc-v2 # Contracts for which the bindings should be generated. -required_contracts := Bridge MaintainerProxy LightRelay LightRelayMaintainerProxy WalletProposalValidator +required_contracts := Bridge MaintainerProxy LightRelay LightRelayMaintainerProxy WalletProposalValidator RedemptionWatchtower # There is a bug in the currently used abigen version (v1.10.19) that makes it # re-declaring structs used by multiple contracts diff --git a/pkg/chain/ethereum/tbtc/gen/_address/RedemptionWatchtower b/pkg/chain/ethereum/tbtc/gen/_address/RedemptionWatchtower new file mode 100644 index 0000000000..e69de29bb2 diff --git a/pkg/chain/ethereum/tbtc/gen/abi/Bridge.go b/pkg/chain/ethereum/tbtc/gen/abi/Bridge.go index 061982f3c2..e76e6f779f 100644 --- a/pkg/chain/ethereum/tbtc/gen/abi/Bridge.go +++ b/pkg/chain/ethereum/tbtc/gen/abi/Bridge.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // BitcoinTxInfo is an auto generated low-level Go binding around an user-defined struct. @@ -120,7 +121,7 @@ type WalletsWallet struct { // BridgeMetaData contains all meta data concerning the Bridge contract. var BridgeMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"fundingTxHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"DepositRevealed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sweepTxHash\",\"type\":\"bytes32\"}],\"name\":\"DepositsSwept\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeDefeatTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeDefeated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"FraudParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldGovernance\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"GovernanceTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTxOutputIndex\",\"type\":\"uint32\"}],\"name\":\"MovedFundsSweepTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sweepTxHash\",\"type\":\"bytes32\"}],\"name\":\"MovedFundsSwept\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsBelowDustReported\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"}],\"name\":\"MovingFundsCommitmentSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"}],\"name\":\"MovingFundsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"MovingFundsParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsTimeoutReset\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"NewWalletRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"NewWalletRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"RedemptionParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"RedemptionTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"redemptionTxHash\",\"type\":\"bytes32\"}],\"name\":\"RedemptionsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spvMaintainer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"SpvMaintainerStatusUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"VaultStatusUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletClosing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletMovingFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"name\":\"WalletParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletTerminated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyY\",\"type\":\"bytes32\"}],\"name\":\"__ecdsaWalletCreatedCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyY\",\"type\":\"bytes32\"}],\"name\":\"__ecdsaWalletHeartbeatFailedCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"activeWalletPubKeyHash\",\"outputs\":[{\"internalType\":\"bytes20\",\"name\":\"\",\"type\":\"bytes20\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contractReferences\",\"outputs\":[{\"internalType\":\"contractBank\",\"name\":\"bank\",\"type\":\"address\"},{\"internalType\":\"contractIRelay\",\"name\":\"relay\",\"type\":\"address\"},{\"internalType\":\"contractIWalletRegistry\",\"name\":\"ecdsaWalletRegistry\",\"type\":\"address\"},{\"internalType\":\"contractReimbursementPool\",\"name\":\"reimbursementPool\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"preimage\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"witness\",\"type\":\"bool\"}],\"name\":\"defeatFraudChallenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"heartbeatMessage\",\"type\":\"bytes\"}],\"name\":\"defeatFraudChallengeWithHeartbeat\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"depositKey\",\"type\":\"uint256\"}],\"name\":\"deposits\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"revealedAt\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"sweptAt\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"}],\"internalType\":\"structDeposit.DepositRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"challengeKey\",\"type\":\"uint256\"}],\"name\":\"fraudChallenges\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"reportedAt\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"}],\"internalType\":\"structFraud.FraudChallenge\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fraudParameters\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_bank\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_relay\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ecdsaWalletRegistry\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_reimbursementPool\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_txProofDifficultyFactor\",\"type\":\"uint96\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"isVaultTrusted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liveWalletsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestKey\",\"type\":\"uint256\"}],\"name\":\"movedFundsSweepRequests\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"createdAt\",\"type\":\"uint32\"},{\"internalType\":\"enumMovingFunds.MovedFundsSweepRequestState\",\"name\":\"state\",\"type\":\"uint8\"}],\"internalType\":\"structMovingFunds.MovedFundsSweepRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"movingFundsParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bytes\",\"name\":\"preimageSha256\",\"type\":\"bytes\"}],\"name\":\"notifyFraudChallengeDefeatTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTxOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"}],\"name\":\"notifyMovedFundsSweepTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"}],\"name\":\"notifyMovingFundsBelowDust\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"}],\"name\":\"notifyMovingFundsTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"notifyRedemptionTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"notifyWalletCloseable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"notifyWalletClosingPeriodElapsed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"pendingRedemptions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"requestedAt\",\"type\":\"uint32\"}],\"internalType\":\"structRedemption.RedemptionRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"balanceOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"redemptionData\",\"type\":\"bytes\"}],\"name\":\"receiveBalanceApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"redemptionParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"activeWalletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"requestNewWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"requestRedemption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"resetMovingFundsTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"internalType\":\"structDeposit.DepositRevealInfo\",\"name\":\"reveal\",\"type\":\"tuple\"}],\"name\":\"revealDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"internalType\":\"structDeposit.DepositRevealInfo\",\"name\":\"reveal\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"}],\"name\":\"revealDepositWithExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spvMaintainer\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"setSpvMaintainerStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"setVaultStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"utxoKey\",\"type\":\"uint256\"}],\"name\":\"spentMainUTXOs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"sweepTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"sweepProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"submitDepositSweepProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"preimageSha256\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"structBitcoinTx.RSVSignature\",\"name\":\"signature\",\"type\":\"tuple\"}],\"name\":\"submitFraudChallenge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"sweepTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"sweepProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"}],\"name\":\"submitMovedFundsSweepProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"walletMemberIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"}],\"name\":\"submitMovingFundsCommitment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"movingFundsTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"movingFundsProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"submitMovingFundsProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"redemptionTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"redemptionProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"submitRedemptionProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"timedOutRedemptions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"requestedAt\",\"type\":\"uint32\"}],\"internalType\":\"structRedemption.RedemptionRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"txProofDifficultyFactor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateFraudParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateMovingFundsParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateRedemptionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"name\":\"updateWalletParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"walletParameters\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"wallets\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mainUtxoHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"pendingRedemptionsValue\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"createdAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsRequestedAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"closingStartedAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"pendingMovedFundsSweepRequestsCount\",\"type\":\"uint32\"},{\"internalType\":\"enumWallets.WalletState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"movingFundsTargetWalletsCommitmentHash\",\"type\":\"bytes32\"}],\"internalType\":\"structWallets.Wallet\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"name\":\"DepositParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"fundingTxHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"DepositRevealed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sweepTxHash\",\"type\":\"bytes32\"}],\"name\":\"DepositsSwept\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeDefeatTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeDefeated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sighash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"}],\"name\":\"FraudChallengeSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"FraudParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"oldGovernance\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"GovernanceTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTxOutputIndex\",\"type\":\"uint32\"}],\"name\":\"MovedFundsSweepTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"sweepTxHash\",\"type\":\"bytes32\"}],\"name\":\"MovedFundsSwept\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsBelowDustReported\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"submitter\",\"type\":\"address\"}],\"name\":\"MovingFundsCommitmentSubmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"}],\"name\":\"MovingFundsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"MovingFundsParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"MovingFundsTimeoutReset\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"NewWalletRegistered\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[],\"name\":\"NewWalletRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"RedemptionParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"}],\"name\":\"RedemptionRequested\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"RedemptionTimedOut\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"redemptionWatchtower\",\"type\":\"address\"}],\"name\":\"RedemptionWatchtowerSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"redemptionTxHash\",\"type\":\"bytes32\"}],\"name\":\"RedemptionsCompleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"spvMaintainer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"SpvMaintainerStatusUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"TreasuryUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"VaultStatusUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletClosed\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletClosing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletMovingFunds\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"name\":\"WalletParametersUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"WalletTerminated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyY\",\"type\":\"bytes32\"}],\"name\":\"__ecdsaWalletCreatedCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyX\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"publicKeyY\",\"type\":\"bytes32\"}],\"name\":\"__ecdsaWalletHeartbeatFailedCallback\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"activeWalletPubKeyHash\",\"outputs\":[{\"internalType\":\"bytes20\",\"name\":\"\",\"type\":\"bytes20\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"contractReferences\",\"outputs\":[{\"internalType\":\"contractBank\",\"name\":\"bank\",\"type\":\"address\"},{\"internalType\":\"contractIRelay\",\"name\":\"relay\",\"type\":\"address\"},{\"internalType\":\"contractIWalletRegistry\",\"name\":\"ecdsaWalletRegistry\",\"type\":\"address\"},{\"internalType\":\"contractReimbursementPool\",\"name\":\"reimbursementPool\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"preimage\",\"type\":\"bytes\"},{\"internalType\":\"bool\",\"name\":\"witness\",\"type\":\"bool\"}],\"name\":\"defeatFraudChallenge\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"heartbeatMessage\",\"type\":\"bytes\"}],\"name\":\"defeatFraudChallengeWithHeartbeat\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"depositParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"depositKey\",\"type\":\"uint256\"}],\"name\":\"deposits\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"depositor\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"revealedAt\",\"type\":\"uint32\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"sweptAt\",\"type\":\"uint32\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"}],\"internalType\":\"structDeposit.DepositRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"challengeKey\",\"type\":\"uint256\"}],\"name\":\"fraudChallenges\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"challenger\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"depositAmount\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"reportedAt\",\"type\":\"uint32\"},{\"internalType\":\"bool\",\"name\":\"resolved\",\"type\":\"bool\"}],\"internalType\":\"structFraud.FraudChallenge\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"fraudParameters\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getRedemptionWatchtower\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"governance\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_bank\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_relay\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_treasury\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"_ecdsaWalletRegistry\",\"type\":\"address\"},{\"internalType\":\"addresspayable\",\"name\":\"_reimbursementPool\",\"type\":\"address\"},{\"internalType\":\"uint96\",\"name\":\"_txProofDifficultyFactor\",\"type\":\"uint96\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"isVaultTrusted\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"liveWalletsCount\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"requestKey\",\"type\":\"uint256\"}],\"name\":\"movedFundsSweepRequests\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint64\",\"name\":\"value\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"createdAt\",\"type\":\"uint32\"},{\"internalType\":\"enumMovingFunds.MovedFundsSweepRequestState\",\"name\":\"state\",\"type\":\"uint8\"}],\"internalType\":\"structMovingFunds.MovedFundsSweepRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"movingFundsParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bytes\",\"name\":\"preimageSha256\",\"type\":\"bytes\"}],\"name\":\"notifyFraudChallengeDefeatTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTxOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"}],\"name\":\"notifyMovedFundsSweepTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"}],\"name\":\"notifyMovingFundsBelowDust\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"}],\"name\":\"notifyMovingFundsTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"notifyRedemptionTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"notifyRedemptionVeto\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"notifyWalletCloseable\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"notifyWalletClosingPeriodElapsed\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"pendingRedemptions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"requestedAt\",\"type\":\"uint32\"}],\"internalType\":\"structRedemption.RedemptionRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"balanceOwner\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"redemptionData\",\"type\":\"bytes\"}],\"name\":\"receiveBalanceApproval\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"redemptionParameters\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"activeWalletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"requestNewWallet\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"requestRedemption\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"resetMovingFundsTimeout\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"internalType\":\"structDeposit.DepositRevealInfo\",\"name\":\"reveal\",\"type\":\"tuple\"}],\"name\":\"revealDeposit\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"internalType\":\"structDeposit.DepositRevealInfo\",\"name\":\"reveal\",\"type\":\"tuple\"},{\"internalType\":\"bytes32\",\"name\":\"extraData\",\"type\":\"bytes32\"}],\"name\":\"revealDepositWithExtraData\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"redemptionWatchtower\",\"type\":\"address\"}],\"name\":\"setRedemptionWatchtower\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spvMaintainer\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"setSpvMaintainerStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"isTrusted\",\"type\":\"bool\"}],\"name\":\"setVaultStatus\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"utxoKey\",\"type\":\"uint256\"}],\"name\":\"spentMainUTXOs\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"sweepTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"sweepProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"address\",\"name\":\"vault\",\"type\":\"address\"}],\"name\":\"submitDepositSweepProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"walletPublicKey\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"preimageSha256\",\"type\":\"bytes\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\"},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\"}],\"internalType\":\"structBitcoinTx.RSVSignature\",\"name\":\"signature\",\"type\":\"tuple\"}],\"name\":\"submitFraudChallenge\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"sweepTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"sweepProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"}],\"name\":\"submitMovedFundsSweepProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"uint32[]\",\"name\":\"walletMembersIDs\",\"type\":\"uint32[]\"},{\"internalType\":\"uint256\",\"name\":\"walletMemberIndex\",\"type\":\"uint256\"},{\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"}],\"name\":\"submitMovingFundsCommitment\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"movingFundsTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"movingFundsProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"submitMovingFundsProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"redemptionTx\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes\",\"name\":\"merkleProof\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"txIndexInBlock\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"bitcoinHeaders\",\"type\":\"bytes\"},{\"internalType\":\"bytes32\",\"name\":\"coinbasePreimage\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"coinbaseProof\",\"type\":\"bytes\"}],\"internalType\":\"structBitcoinTx.Proof\",\"name\":\"redemptionProof\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"mainUtxo\",\"type\":\"tuple\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"submitRedemptionProof\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"timedOutRedemptions\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"requestedAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"treasuryFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"txMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"requestedAt\",\"type\":\"uint32\"}],\"internalType\":\"structRedemption.RedemptionRequest\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newGovernance\",\"type\":\"address\"}],\"name\":\"transferGovernance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"treasury\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"txProofDifficultyFactor\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"depositDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"depositTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"depositRevealAheadPeriod\",\"type\":\"uint32\"}],\"name\":\"updateDepositParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint96\",\"name\":\"fraudChallengeDepositAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudChallengeDefeatTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"fraudSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"fraudNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateFraudParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"movingFundsTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"movingFundsDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutResetDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movingFundsTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"},{\"internalType\":\"uint16\",\"name\":\"movingFundsCommitmentGasOffset\",\"type\":\"uint16\"},{\"internalType\":\"uint64\",\"name\":\"movedFundsSweepTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"movedFundsSweepTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"movedFundsSweepTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateMovingFundsParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint64\",\"name\":\"redemptionDustThreshold\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTreasuryFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxFee\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"redemptionTxMaxTotalFee\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeout\",\"type\":\"uint32\"},{\"internalType\":\"uint96\",\"name\":\"redemptionTimeoutSlashingAmount\",\"type\":\"uint96\"},{\"internalType\":\"uint32\",\"name\":\"redemptionTimeoutNotifierRewardMultiplier\",\"type\":\"uint32\"}],\"name\":\"updateRedemptionParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"treasury\",\"type\":\"address\"}],\"name\":\"updateTreasury\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"name\":\"updateWalletParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"walletParameters\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"walletCreationPeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletCreationMaxBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint64\",\"name\":\"walletClosureMinBtcBalance\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletMaxAge\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"walletMaxBtcTransfer\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"walletClosingPeriod\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"}],\"name\":\"wallets\",\"outputs\":[{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"ecdsaWalletID\",\"type\":\"bytes32\"},{\"internalType\":\"bytes32\",\"name\":\"mainUtxoHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"pendingRedemptionsValue\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"createdAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsRequestedAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"closingStartedAt\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"pendingMovedFundsSweepRequestsCount\",\"type\":\"uint32\"},{\"internalType\":\"enumWallets.WalletState\",\"name\":\"state\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"movingFundsTargetWalletsCommitmentHash\",\"type\":\"bytes32\"}],\"internalType\":\"structWallets.Wallet\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // BridgeABI is the input ABI used to generate the binding from. @@ -224,11 +225,11 @@ func NewBridgeFilterer(address common.Address, filterer bind.ContractFilterer) ( // bindBridge binds a generic wrapper to an already deployed contract. func bindBridge(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(BridgeABI)) + parsed, err := BridgeMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -527,6 +528,37 @@ func (_Bridge *BridgeCallerSession) FraudParameters() (struct { return _Bridge.Contract.FraudParameters(&_Bridge.CallOpts) } +// GetRedemptionWatchtower is a free data retrieval call binding the contract method 0x5f3281ca. +// +// Solidity: function getRedemptionWatchtower() view returns(address) +func (_Bridge *BridgeCaller) GetRedemptionWatchtower(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _Bridge.contract.Call(opts, &out, "getRedemptionWatchtower") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// GetRedemptionWatchtower is a free data retrieval call binding the contract method 0x5f3281ca. +// +// Solidity: function getRedemptionWatchtower() view returns(address) +func (_Bridge *BridgeSession) GetRedemptionWatchtower() (common.Address, error) { + return _Bridge.Contract.GetRedemptionWatchtower(&_Bridge.CallOpts) +} + +// GetRedemptionWatchtower is a free data retrieval call binding the contract method 0x5f3281ca. +// +// Solidity: function getRedemptionWatchtower() view returns(address) +func (_Bridge *BridgeCallerSession) GetRedemptionWatchtower() (common.Address, error) { + return _Bridge.Contract.GetRedemptionWatchtower(&_Bridge.CallOpts) +} + // Governance is a free data retrieval call binding the contract method 0x5aa6e675. // // Solidity: function governance() view returns(address) @@ -1277,6 +1309,27 @@ func (_Bridge *BridgeTransactorSession) NotifyRedemptionTimeout(walletPubKeyHash return _Bridge.Contract.NotifyRedemptionTimeout(&_Bridge.TransactOpts, walletPubKeyHash, walletMembersIDs, redeemerOutputScript) } +// NotifyRedemptionVeto is a paid mutator transaction binding the contract method 0x11026ef8. +// +// Solidity: function notifyRedemptionVeto(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_Bridge *BridgeTransactor) NotifyRedemptionVeto(opts *bind.TransactOpts, walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _Bridge.contract.Transact(opts, "notifyRedemptionVeto", walletPubKeyHash, redeemerOutputScript) +} + +// NotifyRedemptionVeto is a paid mutator transaction binding the contract method 0x11026ef8. +// +// Solidity: function notifyRedemptionVeto(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_Bridge *BridgeSession) NotifyRedemptionVeto(walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _Bridge.Contract.NotifyRedemptionVeto(&_Bridge.TransactOpts, walletPubKeyHash, redeemerOutputScript) +} + +// NotifyRedemptionVeto is a paid mutator transaction binding the contract method 0x11026ef8. +// +// Solidity: function notifyRedemptionVeto(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_Bridge *BridgeTransactorSession) NotifyRedemptionVeto(walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _Bridge.Contract.NotifyRedemptionVeto(&_Bridge.TransactOpts, walletPubKeyHash, redeemerOutputScript) +} + // NotifyWalletCloseable is a paid mutator transaction binding the contract method 0xe44bdd31. // // Solidity: function notifyWalletCloseable(bytes20 walletPubKeyHash, (bytes32,uint32,uint64) walletMainUtxo) returns() @@ -1445,6 +1498,27 @@ func (_Bridge *BridgeTransactorSession) RevealDepositWithExtraData(fundingTx Bit return _Bridge.Contract.RevealDepositWithExtraData(&_Bridge.TransactOpts, fundingTx, reveal, extraData) } +// SetRedemptionWatchtower is a paid mutator transaction binding the contract method 0xbe26ebad. +// +// Solidity: function setRedemptionWatchtower(address redemptionWatchtower) returns() +func (_Bridge *BridgeTransactor) SetRedemptionWatchtower(opts *bind.TransactOpts, redemptionWatchtower common.Address) (*types.Transaction, error) { + return _Bridge.contract.Transact(opts, "setRedemptionWatchtower", redemptionWatchtower) +} + +// SetRedemptionWatchtower is a paid mutator transaction binding the contract method 0xbe26ebad. +// +// Solidity: function setRedemptionWatchtower(address redemptionWatchtower) returns() +func (_Bridge *BridgeSession) SetRedemptionWatchtower(redemptionWatchtower common.Address) (*types.Transaction, error) { + return _Bridge.Contract.SetRedemptionWatchtower(&_Bridge.TransactOpts, redemptionWatchtower) +} + +// SetRedemptionWatchtower is a paid mutator transaction binding the contract method 0xbe26ebad. +// +// Solidity: function setRedemptionWatchtower(address redemptionWatchtower) returns() +func (_Bridge *BridgeTransactorSession) SetRedemptionWatchtower(redemptionWatchtower common.Address) (*types.Transaction, error) { + return _Bridge.Contract.SetRedemptionWatchtower(&_Bridge.TransactOpts, redemptionWatchtower) +} + // SetSpvMaintainerStatus is a paid mutator transaction binding the contract method 0x5f2b2d0d. // // Solidity: function setSpvMaintainerStatus(address spvMaintainer, bool isTrusted) returns() @@ -4926,6 +5000,140 @@ func (_Bridge *BridgeFilterer) ParseRedemptionTimedOut(log types.Log) (*BridgeRe return event, nil } +// BridgeRedemptionWatchtowerSetIterator is returned from FilterRedemptionWatchtowerSet and is used to iterate over the raw logs and unpacked data for RedemptionWatchtowerSet events raised by the Bridge contract. +type BridgeRedemptionWatchtowerSetIterator struct { + Event *BridgeRedemptionWatchtowerSet // 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 *BridgeRedemptionWatchtowerSetIterator) 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(BridgeRedemptionWatchtowerSet) + 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(BridgeRedemptionWatchtowerSet) + 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 *BridgeRedemptionWatchtowerSetIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *BridgeRedemptionWatchtowerSetIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// BridgeRedemptionWatchtowerSet represents a RedemptionWatchtowerSet event raised by the Bridge contract. +type BridgeRedemptionWatchtowerSet struct { + RedemptionWatchtower common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterRedemptionWatchtowerSet is a free log retrieval operation binding the contract event 0x13f696992cabdd1b00afcc752ff98fe39e3fe341c16ed5f55e55c64875de0b99. +// +// Solidity: event RedemptionWatchtowerSet(address redemptionWatchtower) +func (_Bridge *BridgeFilterer) FilterRedemptionWatchtowerSet(opts *bind.FilterOpts) (*BridgeRedemptionWatchtowerSetIterator, error) { + + logs, sub, err := _Bridge.contract.FilterLogs(opts, "RedemptionWatchtowerSet") + if err != nil { + return nil, err + } + return &BridgeRedemptionWatchtowerSetIterator{contract: _Bridge.contract, event: "RedemptionWatchtowerSet", logs: logs, sub: sub}, nil +} + +// WatchRedemptionWatchtowerSet is a free log subscription operation binding the contract event 0x13f696992cabdd1b00afcc752ff98fe39e3fe341c16ed5f55e55c64875de0b99. +// +// Solidity: event RedemptionWatchtowerSet(address redemptionWatchtower) +func (_Bridge *BridgeFilterer) WatchRedemptionWatchtowerSet(opts *bind.WatchOpts, sink chan<- *BridgeRedemptionWatchtowerSet) (event.Subscription, error) { + + logs, sub, err := _Bridge.contract.WatchLogs(opts, "RedemptionWatchtowerSet") + 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(BridgeRedemptionWatchtowerSet) + if err := _Bridge.contract.UnpackLog(event, "RedemptionWatchtowerSet", 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 +} + +// ParseRedemptionWatchtowerSet is a log parse operation binding the contract event 0x13f696992cabdd1b00afcc752ff98fe39e3fe341c16ed5f55e55c64875de0b99. +// +// Solidity: event RedemptionWatchtowerSet(address redemptionWatchtower) +func (_Bridge *BridgeFilterer) ParseRedemptionWatchtowerSet(log types.Log) (*BridgeRedemptionWatchtowerSet, error) { + event := new(BridgeRedemptionWatchtowerSet) + if err := _Bridge.contract.UnpackLog(event, "RedemptionWatchtowerSet", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + // BridgeRedemptionsCompletedIterator is returned from FilterRedemptionsCompleted and is used to iterate over the raw logs and unpacked data for RedemptionsCompleted events raised by the Bridge contract. type BridgeRedemptionsCompletedIterator struct { Event *BridgeRedemptionsCompleted // Event containing the contract specifics and raw log diff --git a/pkg/chain/ethereum/tbtc/gen/abi/RedemptionWatchtower.go b/pkg/chain/ethereum/tbtc/gen/abi/RedemptionWatchtower.go new file mode 100644 index 0000000000..30c4b7ca59 --- /dev/null +++ b/pkg/chain/ethereum/tbtc/gen/abi/RedemptionWatchtower.go @@ -0,0 +1,2893 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package abi + +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 +) + +// RedemptionWatchtowerMetaData contains all meta data concerning the RedemptionWatchtower contract. +var RedemptionWatchtowerMetaData = &bind.MetaData{ + ABI: "[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"}],\"name\":\"Banned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guardian\",\"type\":\"address\"}],\"name\":\"GuardianAdded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guardian\",\"type\":\"address\"}],\"name\":\"GuardianRemoved\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"guardian\",\"type\":\"address\"}],\"name\":\"ObjectionRaised\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"}],\"name\":\"Unbanned\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"VetoFinalized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"VetoPeriodCheckOmitted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"amount\",\"type\":\"uint64\"}],\"name\":\"VetoedFundsWithdrawn\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"disabledAt\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"executor\",\"type\":\"address\"}],\"name\":\"WatchtowerDisabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"enabledAt\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"manager\",\"type\":\"address\"}],\"name\":\"WatchtowerEnabled\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"watchtowerLifetime\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"vetoPenaltyFeeDivisor\",\"type\":\"uint64\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"vetoFreezePeriod\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"defaultDelay\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"levelOneDelay\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"levelTwoDelay\",\"type\":\"uint32\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"waivedAmountLimit\",\"type\":\"uint64\"}],\"name\":\"WatchtowerParametersUpdated\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guardian\",\"type\":\"address\"}],\"name\":\"addGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bank\",\"outputs\":[{\"internalType\":\"contractBank\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contractBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"defaultDelay\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"disableWatchtower\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_manager\",\"type\":\"address\"},{\"internalType\":\"address[]\",\"name\":\"_guardians\",\"type\":\"address[]\"}],\"name\":\"enableWatchtower\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"getRedemptionDelay\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"contractBridge\",\"name\":\"_bridge\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isBanned\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"name\":\"isGuardian\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"},{\"internalType\":\"address\",\"name\":\"balanceOwner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"}],\"name\":\"isSafeRedemption\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"levelOneDelay\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"levelTwoDelay\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"manager\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"objections\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes\",\"name\":\"redeemerOutputScript\",\"type\":\"bytes\"}],\"name\":\"raiseObjection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"guardian\",\"type\":\"address\"}],\"name\":\"removeGuardian\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"}],\"name\":\"unban\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint32\",\"name\":\"_watchtowerLifetime\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_vetoPenaltyFeeDivisor\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"_vetoFreezePeriod\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_defaultDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_levelOneDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint32\",\"name\":\"_levelTwoDelay\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"_waivedAmountLimit\",\"type\":\"uint64\"}],\"name\":\"updateWatchtowerParameters\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vetoFreezePeriod\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"vetoPenaltyFeeDivisor\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"vetoProposals\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"redeemer\",\"type\":\"address\"},{\"internalType\":\"uint64\",\"name\":\"withdrawableAmount\",\"type\":\"uint64\"},{\"internalType\":\"uint32\",\"name\":\"finalizedAt\",\"type\":\"uint32\"},{\"internalType\":\"uint8\",\"name\":\"objectionsCount\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"waivedAmountLimit\",\"outputs\":[{\"internalType\":\"uint64\",\"name\":\"\",\"type\":\"uint64\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"watchtowerDisabledAt\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"watchtowerEnabledAt\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"watchtowerLifetime\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"redemptionKey\",\"type\":\"uint256\"}],\"name\":\"withdrawVetoedFunds\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}]", +} + +// RedemptionWatchtowerABI is the input ABI used to generate the binding from. +// Deprecated: Use RedemptionWatchtowerMetaData.ABI instead. +var RedemptionWatchtowerABI = RedemptionWatchtowerMetaData.ABI + +// RedemptionWatchtower is an auto generated Go binding around an Ethereum contract. +type RedemptionWatchtower struct { + RedemptionWatchtowerCaller // Read-only binding to the contract + RedemptionWatchtowerTransactor // Write-only binding to the contract + RedemptionWatchtowerFilterer // Log filterer for contract events +} + +// RedemptionWatchtowerCaller is an auto generated read-only Go binding around an Ethereum contract. +type RedemptionWatchtowerCaller struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RedemptionWatchtowerTransactor is an auto generated write-only Go binding around an Ethereum contract. +type RedemptionWatchtowerTransactor struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RedemptionWatchtowerFilterer is an auto generated log filtering Go binding around an Ethereum contract events. +type RedemptionWatchtowerFilterer struct { + contract *bind.BoundContract // Generic contract wrapper for the low level calls +} + +// RedemptionWatchtowerSession is an auto generated Go binding around an Ethereum contract, +// with pre-set call and transact options. +type RedemptionWatchtowerSession struct { + Contract *RedemptionWatchtower // 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 +} + +// RedemptionWatchtowerCallerSession is an auto generated read-only Go binding around an Ethereum contract, +// with pre-set call options. +type RedemptionWatchtowerCallerSession struct { + Contract *RedemptionWatchtowerCaller // Generic contract caller binding to set the session for + CallOpts bind.CallOpts // Call options to use throughout this session +} + +// RedemptionWatchtowerTransactorSession is an auto generated write-only Go binding around an Ethereum contract, +// with pre-set transact options. +type RedemptionWatchtowerTransactorSession struct { + Contract *RedemptionWatchtowerTransactor // Generic contract transactor binding to set the session for + TransactOpts bind.TransactOpts // Transaction auth options to use throughout this session +} + +// RedemptionWatchtowerRaw is an auto generated low-level Go binding around an Ethereum contract. +type RedemptionWatchtowerRaw struct { + Contract *RedemptionWatchtower // Generic contract binding to access the raw methods on +} + +// RedemptionWatchtowerCallerRaw is an auto generated low-level read-only Go binding around an Ethereum contract. +type RedemptionWatchtowerCallerRaw struct { + Contract *RedemptionWatchtowerCaller // Generic read-only contract binding to access the raw methods on +} + +// RedemptionWatchtowerTransactorRaw is an auto generated low-level write-only Go binding around an Ethereum contract. +type RedemptionWatchtowerTransactorRaw struct { + Contract *RedemptionWatchtowerTransactor // Generic write-only contract binding to access the raw methods on +} + +// NewRedemptionWatchtower creates a new instance of RedemptionWatchtower, bound to a specific deployed contract. +func NewRedemptionWatchtower(address common.Address, backend bind.ContractBackend) (*RedemptionWatchtower, error) { + contract, err := bindRedemptionWatchtower(address, backend, backend, backend) + if err != nil { + return nil, err + } + return &RedemptionWatchtower{RedemptionWatchtowerCaller: RedemptionWatchtowerCaller{contract: contract}, RedemptionWatchtowerTransactor: RedemptionWatchtowerTransactor{contract: contract}, RedemptionWatchtowerFilterer: RedemptionWatchtowerFilterer{contract: contract}}, nil +} + +// NewRedemptionWatchtowerCaller creates a new read-only instance of RedemptionWatchtower, bound to a specific deployed contract. +func NewRedemptionWatchtowerCaller(address common.Address, caller bind.ContractCaller) (*RedemptionWatchtowerCaller, error) { + contract, err := bindRedemptionWatchtower(address, caller, nil, nil) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerCaller{contract: contract}, nil +} + +// NewRedemptionWatchtowerTransactor creates a new write-only instance of RedemptionWatchtower, bound to a specific deployed contract. +func NewRedemptionWatchtowerTransactor(address common.Address, transactor bind.ContractTransactor) (*RedemptionWatchtowerTransactor, error) { + contract, err := bindRedemptionWatchtower(address, nil, transactor, nil) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerTransactor{contract: contract}, nil +} + +// NewRedemptionWatchtowerFilterer creates a new log filterer instance of RedemptionWatchtower, bound to a specific deployed contract. +func NewRedemptionWatchtowerFilterer(address common.Address, filterer bind.ContractFilterer) (*RedemptionWatchtowerFilterer, error) { + contract, err := bindRedemptionWatchtower(address, nil, nil, filterer) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerFilterer{contract: contract}, nil +} + +// bindRedemptionWatchtower binds a generic wrapper to an already deployed contract. +func bindRedemptionWatchtower(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { + parsed, err := RedemptionWatchtowerMetaData.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 (_RedemptionWatchtower *RedemptionWatchtowerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RedemptionWatchtower.Contract.RedemptionWatchtowerCaller.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 (_RedemptionWatchtower *RedemptionWatchtowerRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RedemptionWatchtowerTransactor.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_RedemptionWatchtower *RedemptionWatchtowerRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RedemptionWatchtowerTransactor.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 (_RedemptionWatchtower *RedemptionWatchtowerCallerRaw) Call(opts *bind.CallOpts, result *[]interface{}, method string, params ...interface{}) error { + return _RedemptionWatchtower.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 (_RedemptionWatchtower *RedemptionWatchtowerTransactorRaw) Transfer(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.contract.Transfer(opts) +} + +// Transact invokes the (paid) contract method with params as input values. +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorRaw) Transact(opts *bind.TransactOpts, method string, params ...interface{}) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.contract.Transact(opts, method, params...) +} + +// Bank is a free data retrieval call binding the contract method 0x76cdb03b. +// +// Solidity: function bank() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) Bank(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "bank") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Bank is a free data retrieval call binding the contract method 0x76cdb03b. +// +// Solidity: function bank() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Bank() (common.Address, error) { + return _RedemptionWatchtower.Contract.Bank(&_RedemptionWatchtower.CallOpts) +} + +// Bank is a free data retrieval call binding the contract method 0x76cdb03b. +// +// Solidity: function bank() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) Bank() (common.Address, error) { + return _RedemptionWatchtower.Contract.Bank(&_RedemptionWatchtower.CallOpts) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) Bridge(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "bridge") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Bridge() (common.Address, error) { + return _RedemptionWatchtower.Contract.Bridge(&_RedemptionWatchtower.CallOpts) +} + +// Bridge is a free data retrieval call binding the contract method 0xe78cea92. +// +// Solidity: function bridge() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) Bridge() (common.Address, error) { + return _RedemptionWatchtower.Contract.Bridge(&_RedemptionWatchtower.CallOpts) +} + +// DefaultDelay is a free data retrieval call binding the contract method 0x27e72e41. +// +// Solidity: function defaultDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) DefaultDelay(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "defaultDelay") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// DefaultDelay is a free data retrieval call binding the contract method 0x27e72e41. +// +// Solidity: function defaultDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) DefaultDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.DefaultDelay(&_RedemptionWatchtower.CallOpts) +} + +// DefaultDelay is a free data retrieval call binding the contract method 0x27e72e41. +// +// Solidity: function defaultDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) DefaultDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.DefaultDelay(&_RedemptionWatchtower.CallOpts) +} + +// GetRedemptionDelay is a free data retrieval call binding the contract method 0x0df5db70. +// +// Solidity: function getRedemptionDelay(uint256 redemptionKey) view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) GetRedemptionDelay(opts *bind.CallOpts, redemptionKey *big.Int) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "getRedemptionDelay", redemptionKey) + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// GetRedemptionDelay is a free data retrieval call binding the contract method 0x0df5db70. +// +// Solidity: function getRedemptionDelay(uint256 redemptionKey) view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) GetRedemptionDelay(redemptionKey *big.Int) (uint32, error) { + return _RedemptionWatchtower.Contract.GetRedemptionDelay(&_RedemptionWatchtower.CallOpts, redemptionKey) +} + +// GetRedemptionDelay is a free data retrieval call binding the contract method 0x0df5db70. +// +// Solidity: function getRedemptionDelay(uint256 redemptionKey) view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) GetRedemptionDelay(redemptionKey *big.Int) (uint32, error) { + return _RedemptionWatchtower.Contract.GetRedemptionDelay(&_RedemptionWatchtower.CallOpts, redemptionKey) +} + +// IsBanned is a free data retrieval call binding the contract method 0x97f735d5. +// +// Solidity: function isBanned(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) IsBanned(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "isBanned", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsBanned is a free data retrieval call binding the contract method 0x97f735d5. +// +// Solidity: function isBanned(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) IsBanned(arg0 common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsBanned(&_RedemptionWatchtower.CallOpts, arg0) +} + +// IsBanned is a free data retrieval call binding the contract method 0x97f735d5. +// +// Solidity: function isBanned(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) IsBanned(arg0 common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsBanned(&_RedemptionWatchtower.CallOpts, arg0) +} + +// IsGuardian is a free data retrieval call binding the contract method 0x0c68ba21. +// +// Solidity: function isGuardian(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) IsGuardian(opts *bind.CallOpts, arg0 common.Address) (bool, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "isGuardian", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsGuardian is a free data retrieval call binding the contract method 0x0c68ba21. +// +// Solidity: function isGuardian(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) IsGuardian(arg0 common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsGuardian(&_RedemptionWatchtower.CallOpts, arg0) +} + +// IsGuardian is a free data retrieval call binding the contract method 0x0c68ba21. +// +// Solidity: function isGuardian(address ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) IsGuardian(arg0 common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsGuardian(&_RedemptionWatchtower.CallOpts, arg0) +} + +// IsSafeRedemption is a free data retrieval call binding the contract method 0x4eadf73d. +// +// Solidity: function isSafeRedemption(bytes20 walletPubKeyHash, bytes redeemerOutputScript, address balanceOwner, address redeemer) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) IsSafeRedemption(opts *bind.CallOpts, walletPubKeyHash [20]byte, redeemerOutputScript []byte, balanceOwner common.Address, redeemer common.Address) (bool, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "isSafeRedemption", walletPubKeyHash, redeemerOutputScript, balanceOwner, redeemer) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// IsSafeRedemption is a free data retrieval call binding the contract method 0x4eadf73d. +// +// Solidity: function isSafeRedemption(bytes20 walletPubKeyHash, bytes redeemerOutputScript, address balanceOwner, address redeemer) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) IsSafeRedemption(walletPubKeyHash [20]byte, redeemerOutputScript []byte, balanceOwner common.Address, redeemer common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsSafeRedemption(&_RedemptionWatchtower.CallOpts, walletPubKeyHash, redeemerOutputScript, balanceOwner, redeemer) +} + +// IsSafeRedemption is a free data retrieval call binding the contract method 0x4eadf73d. +// +// Solidity: function isSafeRedemption(bytes20 walletPubKeyHash, bytes redeemerOutputScript, address balanceOwner, address redeemer) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) IsSafeRedemption(walletPubKeyHash [20]byte, redeemerOutputScript []byte, balanceOwner common.Address, redeemer common.Address) (bool, error) { + return _RedemptionWatchtower.Contract.IsSafeRedemption(&_RedemptionWatchtower.CallOpts, walletPubKeyHash, redeemerOutputScript, balanceOwner, redeemer) +} + +// LevelOneDelay is a free data retrieval call binding the contract method 0x7825ef49. +// +// Solidity: function levelOneDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) LevelOneDelay(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "levelOneDelay") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// LevelOneDelay is a free data retrieval call binding the contract method 0x7825ef49. +// +// Solidity: function levelOneDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) LevelOneDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.LevelOneDelay(&_RedemptionWatchtower.CallOpts) +} + +// LevelOneDelay is a free data retrieval call binding the contract method 0x7825ef49. +// +// Solidity: function levelOneDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) LevelOneDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.LevelOneDelay(&_RedemptionWatchtower.CallOpts) +} + +// LevelTwoDelay is a free data retrieval call binding the contract method 0x988880d7. +// +// Solidity: function levelTwoDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) LevelTwoDelay(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "levelTwoDelay") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// LevelTwoDelay is a free data retrieval call binding the contract method 0x988880d7. +// +// Solidity: function levelTwoDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) LevelTwoDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.LevelTwoDelay(&_RedemptionWatchtower.CallOpts) +} + +// LevelTwoDelay is a free data retrieval call binding the contract method 0x988880d7. +// +// Solidity: function levelTwoDelay() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) LevelTwoDelay() (uint32, error) { + return _RedemptionWatchtower.Contract.LevelTwoDelay(&_RedemptionWatchtower.CallOpts) +} + +// Manager is a free data retrieval call binding the contract method 0x481c6a75. +// +// Solidity: function manager() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) Manager(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "manager") + + if err != nil { + return *new(common.Address), err + } + + out0 := *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + + return out0, err + +} + +// Manager is a free data retrieval call binding the contract method 0x481c6a75. +// +// Solidity: function manager() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Manager() (common.Address, error) { + return _RedemptionWatchtower.Contract.Manager(&_RedemptionWatchtower.CallOpts) +} + +// Manager is a free data retrieval call binding the contract method 0x481c6a75. +// +// Solidity: function manager() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) Manager() (common.Address, error) { + return _RedemptionWatchtower.Contract.Manager(&_RedemptionWatchtower.CallOpts) +} + +// Objections is a free data retrieval call binding the contract method 0xcc639fab. +// +// Solidity: function objections(uint256 ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) Objections(opts *bind.CallOpts, arg0 *big.Int) (bool, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "objections", arg0) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// Objections is a free data retrieval call binding the contract method 0xcc639fab. +// +// Solidity: function objections(uint256 ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Objections(arg0 *big.Int) (bool, error) { + return _RedemptionWatchtower.Contract.Objections(&_RedemptionWatchtower.CallOpts, arg0) +} + +// Objections is a free data retrieval call binding the contract method 0xcc639fab. +// +// Solidity: function objections(uint256 ) view returns(bool) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) Objections(arg0 *big.Int) (bool, error) { + return _RedemptionWatchtower.Contract.Objections(&_RedemptionWatchtower.CallOpts, arg0) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) Owner(opts *bind.CallOpts) (common.Address, error) { + var out []interface{} + err := _RedemptionWatchtower.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 (_RedemptionWatchtower *RedemptionWatchtowerSession) Owner() (common.Address, error) { + return _RedemptionWatchtower.Contract.Owner(&_RedemptionWatchtower.CallOpts) +} + +// Owner is a free data retrieval call binding the contract method 0x8da5cb5b. +// +// Solidity: function owner() view returns(address) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) Owner() (common.Address, error) { + return _RedemptionWatchtower.Contract.Owner(&_RedemptionWatchtower.CallOpts) +} + +// VetoFreezePeriod is a free data retrieval call binding the contract method 0x33597014. +// +// Solidity: function vetoFreezePeriod() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) VetoFreezePeriod(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "vetoFreezePeriod") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// VetoFreezePeriod is a free data retrieval call binding the contract method 0x33597014. +// +// Solidity: function vetoFreezePeriod() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) VetoFreezePeriod() (uint32, error) { + return _RedemptionWatchtower.Contract.VetoFreezePeriod(&_RedemptionWatchtower.CallOpts) +} + +// VetoFreezePeriod is a free data retrieval call binding the contract method 0x33597014. +// +// Solidity: function vetoFreezePeriod() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) VetoFreezePeriod() (uint32, error) { + return _RedemptionWatchtower.Contract.VetoFreezePeriod(&_RedemptionWatchtower.CallOpts) +} + +// VetoPenaltyFeeDivisor is a free data retrieval call binding the contract method 0xbbaa5dbe. +// +// Solidity: function vetoPenaltyFeeDivisor() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) VetoPenaltyFeeDivisor(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "vetoPenaltyFeeDivisor") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// VetoPenaltyFeeDivisor is a free data retrieval call binding the contract method 0xbbaa5dbe. +// +// Solidity: function vetoPenaltyFeeDivisor() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) VetoPenaltyFeeDivisor() (uint64, error) { + return _RedemptionWatchtower.Contract.VetoPenaltyFeeDivisor(&_RedemptionWatchtower.CallOpts) +} + +// VetoPenaltyFeeDivisor is a free data retrieval call binding the contract method 0xbbaa5dbe. +// +// Solidity: function vetoPenaltyFeeDivisor() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) VetoPenaltyFeeDivisor() (uint64, error) { + return _RedemptionWatchtower.Contract.VetoPenaltyFeeDivisor(&_RedemptionWatchtower.CallOpts) +} + +// VetoProposals is a free data retrieval call binding the contract method 0xfac8da1b. +// +// Solidity: function vetoProposals(uint256 ) view returns(address redeemer, uint64 withdrawableAmount, uint32 finalizedAt, uint8 objectionsCount) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) VetoProposals(opts *bind.CallOpts, arg0 *big.Int) (struct { + Redeemer common.Address + WithdrawableAmount uint64 + FinalizedAt uint32 + ObjectionsCount uint8 +}, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "vetoProposals", arg0) + + outstruct := new(struct { + Redeemer common.Address + WithdrawableAmount uint64 + FinalizedAt uint32 + ObjectionsCount uint8 + }) + if err != nil { + return *outstruct, err + } + + outstruct.Redeemer = *abi.ConvertType(out[0], new(common.Address)).(*common.Address) + outstruct.WithdrawableAmount = *abi.ConvertType(out[1], new(uint64)).(*uint64) + outstruct.FinalizedAt = *abi.ConvertType(out[2], new(uint32)).(*uint32) + outstruct.ObjectionsCount = *abi.ConvertType(out[3], new(uint8)).(*uint8) + + return *outstruct, err + +} + +// VetoProposals is a free data retrieval call binding the contract method 0xfac8da1b. +// +// Solidity: function vetoProposals(uint256 ) view returns(address redeemer, uint64 withdrawableAmount, uint32 finalizedAt, uint8 objectionsCount) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) VetoProposals(arg0 *big.Int) (struct { + Redeemer common.Address + WithdrawableAmount uint64 + FinalizedAt uint32 + ObjectionsCount uint8 +}, error) { + return _RedemptionWatchtower.Contract.VetoProposals(&_RedemptionWatchtower.CallOpts, arg0) +} + +// VetoProposals is a free data retrieval call binding the contract method 0xfac8da1b. +// +// Solidity: function vetoProposals(uint256 ) view returns(address redeemer, uint64 withdrawableAmount, uint32 finalizedAt, uint8 objectionsCount) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) VetoProposals(arg0 *big.Int) (struct { + Redeemer common.Address + WithdrawableAmount uint64 + FinalizedAt uint32 + ObjectionsCount uint8 +}, error) { + return _RedemptionWatchtower.Contract.VetoProposals(&_RedemptionWatchtower.CallOpts, arg0) +} + +// WaivedAmountLimit is a free data retrieval call binding the contract method 0x0a505427. +// +// Solidity: function waivedAmountLimit() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) WaivedAmountLimit(opts *bind.CallOpts) (uint64, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "waivedAmountLimit") + + if err != nil { + return *new(uint64), err + } + + out0 := *abi.ConvertType(out[0], new(uint64)).(*uint64) + + return out0, err + +} + +// WaivedAmountLimit is a free data retrieval call binding the contract method 0x0a505427. +// +// Solidity: function waivedAmountLimit() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) WaivedAmountLimit() (uint64, error) { + return _RedemptionWatchtower.Contract.WaivedAmountLimit(&_RedemptionWatchtower.CallOpts) +} + +// WaivedAmountLimit is a free data retrieval call binding the contract method 0x0a505427. +// +// Solidity: function waivedAmountLimit() view returns(uint64) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) WaivedAmountLimit() (uint64, error) { + return _RedemptionWatchtower.Contract.WaivedAmountLimit(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerDisabledAt is a free data retrieval call binding the contract method 0x16cacdbe. +// +// Solidity: function watchtowerDisabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) WatchtowerDisabledAt(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "watchtowerDisabledAt") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// WatchtowerDisabledAt is a free data retrieval call binding the contract method 0x16cacdbe. +// +// Solidity: function watchtowerDisabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) WatchtowerDisabledAt() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerDisabledAt(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerDisabledAt is a free data retrieval call binding the contract method 0x16cacdbe. +// +// Solidity: function watchtowerDisabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) WatchtowerDisabledAt() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerDisabledAt(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerEnabledAt is a free data retrieval call binding the contract method 0x07a5af43. +// +// Solidity: function watchtowerEnabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) WatchtowerEnabledAt(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "watchtowerEnabledAt") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// WatchtowerEnabledAt is a free data retrieval call binding the contract method 0x07a5af43. +// +// Solidity: function watchtowerEnabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) WatchtowerEnabledAt() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerEnabledAt(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerEnabledAt is a free data retrieval call binding the contract method 0x07a5af43. +// +// Solidity: function watchtowerEnabledAt() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) WatchtowerEnabledAt() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerEnabledAt(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerLifetime is a free data retrieval call binding the contract method 0xedb0b4f9. +// +// Solidity: function watchtowerLifetime() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCaller) WatchtowerLifetime(opts *bind.CallOpts) (uint32, error) { + var out []interface{} + err := _RedemptionWatchtower.contract.Call(opts, &out, "watchtowerLifetime") + + if err != nil { + return *new(uint32), err + } + + out0 := *abi.ConvertType(out[0], new(uint32)).(*uint32) + + return out0, err + +} + +// WatchtowerLifetime is a free data retrieval call binding the contract method 0xedb0b4f9. +// +// Solidity: function watchtowerLifetime() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerSession) WatchtowerLifetime() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerLifetime(&_RedemptionWatchtower.CallOpts) +} + +// WatchtowerLifetime is a free data retrieval call binding the contract method 0xedb0b4f9. +// +// Solidity: function watchtowerLifetime() view returns(uint32) +func (_RedemptionWatchtower *RedemptionWatchtowerCallerSession) WatchtowerLifetime() (uint32, error) { + return _RedemptionWatchtower.Contract.WatchtowerLifetime(&_RedemptionWatchtower.CallOpts) +} + +// AddGuardian is a paid mutator transaction binding the contract method 0xa526d83b. +// +// Solidity: function addGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) AddGuardian(opts *bind.TransactOpts, guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "addGuardian", guardian) +} + +// AddGuardian is a paid mutator transaction binding the contract method 0xa526d83b. +// +// Solidity: function addGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) AddGuardian(guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.AddGuardian(&_RedemptionWatchtower.TransactOpts, guardian) +} + +// AddGuardian is a paid mutator transaction binding the contract method 0xa526d83b. +// +// Solidity: function addGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) AddGuardian(guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.AddGuardian(&_RedemptionWatchtower.TransactOpts, guardian) +} + +// DisableWatchtower is a paid mutator transaction binding the contract method 0xbe773143. +// +// Solidity: function disableWatchtower() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) DisableWatchtower(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "disableWatchtower") +} + +// DisableWatchtower is a paid mutator transaction binding the contract method 0xbe773143. +// +// Solidity: function disableWatchtower() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) DisableWatchtower() (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.DisableWatchtower(&_RedemptionWatchtower.TransactOpts) +} + +// DisableWatchtower is a paid mutator transaction binding the contract method 0xbe773143. +// +// Solidity: function disableWatchtower() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) DisableWatchtower() (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.DisableWatchtower(&_RedemptionWatchtower.TransactOpts) +} + +// EnableWatchtower is a paid mutator transaction binding the contract method 0x344d294d. +// +// Solidity: function enableWatchtower(address _manager, address[] _guardians) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) EnableWatchtower(opts *bind.TransactOpts, _manager common.Address, _guardians []common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "enableWatchtower", _manager, _guardians) +} + +// EnableWatchtower is a paid mutator transaction binding the contract method 0x344d294d. +// +// Solidity: function enableWatchtower(address _manager, address[] _guardians) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) EnableWatchtower(_manager common.Address, _guardians []common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.EnableWatchtower(&_RedemptionWatchtower.TransactOpts, _manager, _guardians) +} + +// EnableWatchtower is a paid mutator transaction binding the contract method 0x344d294d. +// +// Solidity: function enableWatchtower(address _manager, address[] _guardians) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) EnableWatchtower(_manager common.Address, _guardians []common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.EnableWatchtower(&_RedemptionWatchtower.TransactOpts, _manager, _guardians) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) Initialize(opts *bind.TransactOpts, _bridge common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "initialize", _bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Initialize(_bridge common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.Initialize(&_RedemptionWatchtower.TransactOpts, _bridge) +} + +// Initialize is a paid mutator transaction binding the contract method 0xc4d66de8. +// +// Solidity: function initialize(address _bridge) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) Initialize(_bridge common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.Initialize(&_RedemptionWatchtower.TransactOpts, _bridge) +} + +// RaiseObjection is a paid mutator transaction binding the contract method 0xc4bb3785. +// +// Solidity: function raiseObjection(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) RaiseObjection(opts *bind.TransactOpts, walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "raiseObjection", walletPubKeyHash, redeemerOutputScript) +} + +// RaiseObjection is a paid mutator transaction binding the contract method 0xc4bb3785. +// +// Solidity: function raiseObjection(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) RaiseObjection(walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RaiseObjection(&_RedemptionWatchtower.TransactOpts, walletPubKeyHash, redeemerOutputScript) +} + +// RaiseObjection is a paid mutator transaction binding the contract method 0xc4bb3785. +// +// Solidity: function raiseObjection(bytes20 walletPubKeyHash, bytes redeemerOutputScript) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) RaiseObjection(walletPubKeyHash [20]byte, redeemerOutputScript []byte) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RaiseObjection(&_RedemptionWatchtower.TransactOpts, walletPubKeyHash, redeemerOutputScript) +} + +// RemoveGuardian is a paid mutator transaction binding the contract method 0x71404156. +// +// Solidity: function removeGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) RemoveGuardian(opts *bind.TransactOpts, guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "removeGuardian", guardian) +} + +// RemoveGuardian is a paid mutator transaction binding the contract method 0x71404156. +// +// Solidity: function removeGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) RemoveGuardian(guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RemoveGuardian(&_RedemptionWatchtower.TransactOpts, guardian) +} + +// RemoveGuardian is a paid mutator transaction binding the contract method 0x71404156. +// +// Solidity: function removeGuardian(address guardian) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) RemoveGuardian(guardian common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RemoveGuardian(&_RedemptionWatchtower.TransactOpts, guardian) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) RenounceOwnership(opts *bind.TransactOpts) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "renounceOwnership") +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) RenounceOwnership() (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RenounceOwnership(&_RedemptionWatchtower.TransactOpts) +} + +// RenounceOwnership is a paid mutator transaction binding the contract method 0x715018a6. +// +// Solidity: function renounceOwnership() returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) RenounceOwnership() (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.RenounceOwnership(&_RedemptionWatchtower.TransactOpts) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) TransferOwnership(opts *bind.TransactOpts, newOwner common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "transferOwnership", newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.TransferOwnership(&_RedemptionWatchtower.TransactOpts, newOwner) +} + +// TransferOwnership is a paid mutator transaction binding the contract method 0xf2fde38b. +// +// Solidity: function transferOwnership(address newOwner) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) TransferOwnership(newOwner common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.TransferOwnership(&_RedemptionWatchtower.TransactOpts, newOwner) +} + +// Unban is a paid mutator transaction binding the contract method 0xb9f14557. +// +// Solidity: function unban(address redeemer) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) Unban(opts *bind.TransactOpts, redeemer common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "unban", redeemer) +} + +// Unban is a paid mutator transaction binding the contract method 0xb9f14557. +// +// Solidity: function unban(address redeemer) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) Unban(redeemer common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.Unban(&_RedemptionWatchtower.TransactOpts, redeemer) +} + +// Unban is a paid mutator transaction binding the contract method 0xb9f14557. +// +// Solidity: function unban(address redeemer) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) Unban(redeemer common.Address) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.Unban(&_RedemptionWatchtower.TransactOpts, redeemer) +} + +// UpdateWatchtowerParameters is a paid mutator transaction binding the contract method 0x2b98ab23. +// +// Solidity: function updateWatchtowerParameters(uint32 _watchtowerLifetime, uint64 _vetoPenaltyFeeDivisor, uint32 _vetoFreezePeriod, uint32 _defaultDelay, uint32 _levelOneDelay, uint32 _levelTwoDelay, uint64 _waivedAmountLimit) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) UpdateWatchtowerParameters(opts *bind.TransactOpts, _watchtowerLifetime uint32, _vetoPenaltyFeeDivisor uint64, _vetoFreezePeriod uint32, _defaultDelay uint32, _levelOneDelay uint32, _levelTwoDelay uint32, _waivedAmountLimit uint64) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "updateWatchtowerParameters", _watchtowerLifetime, _vetoPenaltyFeeDivisor, _vetoFreezePeriod, _defaultDelay, _levelOneDelay, _levelTwoDelay, _waivedAmountLimit) +} + +// UpdateWatchtowerParameters is a paid mutator transaction binding the contract method 0x2b98ab23. +// +// Solidity: function updateWatchtowerParameters(uint32 _watchtowerLifetime, uint64 _vetoPenaltyFeeDivisor, uint32 _vetoFreezePeriod, uint32 _defaultDelay, uint32 _levelOneDelay, uint32 _levelTwoDelay, uint64 _waivedAmountLimit) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) UpdateWatchtowerParameters(_watchtowerLifetime uint32, _vetoPenaltyFeeDivisor uint64, _vetoFreezePeriod uint32, _defaultDelay uint32, _levelOneDelay uint32, _levelTwoDelay uint32, _waivedAmountLimit uint64) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.UpdateWatchtowerParameters(&_RedemptionWatchtower.TransactOpts, _watchtowerLifetime, _vetoPenaltyFeeDivisor, _vetoFreezePeriod, _defaultDelay, _levelOneDelay, _levelTwoDelay, _waivedAmountLimit) +} + +// UpdateWatchtowerParameters is a paid mutator transaction binding the contract method 0x2b98ab23. +// +// Solidity: function updateWatchtowerParameters(uint32 _watchtowerLifetime, uint64 _vetoPenaltyFeeDivisor, uint32 _vetoFreezePeriod, uint32 _defaultDelay, uint32 _levelOneDelay, uint32 _levelTwoDelay, uint64 _waivedAmountLimit) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) UpdateWatchtowerParameters(_watchtowerLifetime uint32, _vetoPenaltyFeeDivisor uint64, _vetoFreezePeriod uint32, _defaultDelay uint32, _levelOneDelay uint32, _levelTwoDelay uint32, _waivedAmountLimit uint64) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.UpdateWatchtowerParameters(&_RedemptionWatchtower.TransactOpts, _watchtowerLifetime, _vetoPenaltyFeeDivisor, _vetoFreezePeriod, _defaultDelay, _levelOneDelay, _levelTwoDelay, _waivedAmountLimit) +} + +// WithdrawVetoedFunds is a paid mutator transaction binding the contract method 0x126f6e9f. +// +// Solidity: function withdrawVetoedFunds(uint256 redemptionKey) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactor) WithdrawVetoedFunds(opts *bind.TransactOpts, redemptionKey *big.Int) (*types.Transaction, error) { + return _RedemptionWatchtower.contract.Transact(opts, "withdrawVetoedFunds", redemptionKey) +} + +// WithdrawVetoedFunds is a paid mutator transaction binding the contract method 0x126f6e9f. +// +// Solidity: function withdrawVetoedFunds(uint256 redemptionKey) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerSession) WithdrawVetoedFunds(redemptionKey *big.Int) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.WithdrawVetoedFunds(&_RedemptionWatchtower.TransactOpts, redemptionKey) +} + +// WithdrawVetoedFunds is a paid mutator transaction binding the contract method 0x126f6e9f. +// +// Solidity: function withdrawVetoedFunds(uint256 redemptionKey) returns() +func (_RedemptionWatchtower *RedemptionWatchtowerTransactorSession) WithdrawVetoedFunds(redemptionKey *big.Int) (*types.Transaction, error) { + return _RedemptionWatchtower.Contract.WithdrawVetoedFunds(&_RedemptionWatchtower.TransactOpts, redemptionKey) +} + +// RedemptionWatchtowerBannedIterator is returned from FilterBanned and is used to iterate over the raw logs and unpacked data for Banned events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerBannedIterator struct { + Event *RedemptionWatchtowerBanned // 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 *RedemptionWatchtowerBannedIterator) 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(RedemptionWatchtowerBanned) + 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(RedemptionWatchtowerBanned) + 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 *RedemptionWatchtowerBannedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerBannedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerBanned represents a Banned event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerBanned struct { + Redeemer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterBanned is a free log retrieval operation binding the contract event 0x30d1df1214d91553408ca5384ce29e10e5866af8423c628be22860e41fb81005. +// +// Solidity: event Banned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterBanned(opts *bind.FilterOpts, redeemer []common.Address) (*RedemptionWatchtowerBannedIterator, error) { + + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "Banned", redeemerRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerBannedIterator{contract: _RedemptionWatchtower.contract, event: "Banned", logs: logs, sub: sub}, nil +} + +// WatchBanned is a free log subscription operation binding the contract event 0x30d1df1214d91553408ca5384ce29e10e5866af8423c628be22860e41fb81005. +// +// Solidity: event Banned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchBanned(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerBanned, redeemer []common.Address) (event.Subscription, error) { + + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "Banned", redeemerRule) + 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(RedemptionWatchtowerBanned) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Banned", 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 +} + +// ParseBanned is a log parse operation binding the contract event 0x30d1df1214d91553408ca5384ce29e10e5866af8423c628be22860e41fb81005. +// +// Solidity: event Banned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseBanned(log types.Log) (*RedemptionWatchtowerBanned, error) { + event := new(RedemptionWatchtowerBanned) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Banned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerGuardianAddedIterator is returned from FilterGuardianAdded and is used to iterate over the raw logs and unpacked data for GuardianAdded events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerGuardianAddedIterator struct { + Event *RedemptionWatchtowerGuardianAdded // 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 *RedemptionWatchtowerGuardianAddedIterator) 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(RedemptionWatchtowerGuardianAdded) + 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(RedemptionWatchtowerGuardianAdded) + 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 *RedemptionWatchtowerGuardianAddedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerGuardianAddedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerGuardianAdded represents a GuardianAdded event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerGuardianAdded struct { + Guardian common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGuardianAdded is a free log retrieval operation binding the contract event 0x038596bb31e2e7d3d9f184d4c98b310103f6d7f5830e5eec32bffe6f1728f969. +// +// Solidity: event GuardianAdded(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterGuardianAdded(opts *bind.FilterOpts, guardian []common.Address) (*RedemptionWatchtowerGuardianAddedIterator, error) { + + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "GuardianAdded", guardianRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerGuardianAddedIterator{contract: _RedemptionWatchtower.contract, event: "GuardianAdded", logs: logs, sub: sub}, nil +} + +// WatchGuardianAdded is a free log subscription operation binding the contract event 0x038596bb31e2e7d3d9f184d4c98b310103f6d7f5830e5eec32bffe6f1728f969. +// +// Solidity: event GuardianAdded(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchGuardianAdded(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerGuardianAdded, guardian []common.Address) (event.Subscription, error) { + + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "GuardianAdded", guardianRule) + 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(RedemptionWatchtowerGuardianAdded) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "GuardianAdded", 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 +} + +// ParseGuardianAdded is a log parse operation binding the contract event 0x038596bb31e2e7d3d9f184d4c98b310103f6d7f5830e5eec32bffe6f1728f969. +// +// Solidity: event GuardianAdded(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseGuardianAdded(log types.Log) (*RedemptionWatchtowerGuardianAdded, error) { + event := new(RedemptionWatchtowerGuardianAdded) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "GuardianAdded", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerGuardianRemovedIterator is returned from FilterGuardianRemoved and is used to iterate over the raw logs and unpacked data for GuardianRemoved events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerGuardianRemovedIterator struct { + Event *RedemptionWatchtowerGuardianRemoved // 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 *RedemptionWatchtowerGuardianRemovedIterator) 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(RedemptionWatchtowerGuardianRemoved) + 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(RedemptionWatchtowerGuardianRemoved) + 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 *RedemptionWatchtowerGuardianRemovedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerGuardianRemovedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerGuardianRemoved represents a GuardianRemoved event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerGuardianRemoved struct { + Guardian common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterGuardianRemoved is a free log retrieval operation binding the contract event 0xb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c52. +// +// Solidity: event GuardianRemoved(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterGuardianRemoved(opts *bind.FilterOpts, guardian []common.Address) (*RedemptionWatchtowerGuardianRemovedIterator, error) { + + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "GuardianRemoved", guardianRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerGuardianRemovedIterator{contract: _RedemptionWatchtower.contract, event: "GuardianRemoved", logs: logs, sub: sub}, nil +} + +// WatchGuardianRemoved is a free log subscription operation binding the contract event 0xb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c52. +// +// Solidity: event GuardianRemoved(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchGuardianRemoved(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerGuardianRemoved, guardian []common.Address) (event.Subscription, error) { + + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "GuardianRemoved", guardianRule) + 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(RedemptionWatchtowerGuardianRemoved) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "GuardianRemoved", 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 +} + +// ParseGuardianRemoved is a log parse operation binding the contract event 0xb8107d0c6b40be480ce3172ee66ba6d64b71f6b1685a851340036e6e2e3e3c52. +// +// Solidity: event GuardianRemoved(address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseGuardianRemoved(log types.Log) (*RedemptionWatchtowerGuardianRemoved, error) { + event := new(RedemptionWatchtowerGuardianRemoved) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "GuardianRemoved", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerInitializedIterator is returned from FilterInitialized and is used to iterate over the raw logs and unpacked data for Initialized events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerInitializedIterator struct { + Event *RedemptionWatchtowerInitialized // 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 *RedemptionWatchtowerInitializedIterator) 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(RedemptionWatchtowerInitialized) + 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(RedemptionWatchtowerInitialized) + 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 *RedemptionWatchtowerInitializedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerInitializedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerInitialized represents a Initialized event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerInitialized struct { + Version uint8 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterInitialized is a free log retrieval operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterInitialized(opts *bind.FilterOpts) (*RedemptionWatchtowerInitializedIterator, error) { + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "Initialized") + if err != nil { + return nil, err + } + return &RedemptionWatchtowerInitializedIterator{contract: _RedemptionWatchtower.contract, event: "Initialized", logs: logs, sub: sub}, nil +} + +// WatchInitialized is a free log subscription operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchInitialized(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerInitialized) (event.Subscription, error) { + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "Initialized") + 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(RedemptionWatchtowerInitialized) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Initialized", 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 +} + +// ParseInitialized is a log parse operation binding the contract event 0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498. +// +// Solidity: event Initialized(uint8 version) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseInitialized(log types.Log) (*RedemptionWatchtowerInitialized, error) { + event := new(RedemptionWatchtowerInitialized) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Initialized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerObjectionRaisedIterator is returned from FilterObjectionRaised and is used to iterate over the raw logs and unpacked data for ObjectionRaised events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerObjectionRaisedIterator struct { + Event *RedemptionWatchtowerObjectionRaised // 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 *RedemptionWatchtowerObjectionRaisedIterator) 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(RedemptionWatchtowerObjectionRaised) + 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(RedemptionWatchtowerObjectionRaised) + 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 *RedemptionWatchtowerObjectionRaisedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerObjectionRaisedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerObjectionRaised represents a ObjectionRaised event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerObjectionRaised struct { + RedemptionKey *big.Int + Guardian common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterObjectionRaised is a free log retrieval operation binding the contract event 0x5d8525c7222757376eccb2f766e2a81b5afdb98843f7744a33488afe65b42066. +// +// Solidity: event ObjectionRaised(uint256 indexed redemptionKey, address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterObjectionRaised(opts *bind.FilterOpts, redemptionKey []*big.Int, guardian []common.Address) (*RedemptionWatchtowerObjectionRaisedIterator, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "ObjectionRaised", redemptionKeyRule, guardianRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerObjectionRaisedIterator{contract: _RedemptionWatchtower.contract, event: "ObjectionRaised", logs: logs, sub: sub}, nil +} + +// WatchObjectionRaised is a free log subscription operation binding the contract event 0x5d8525c7222757376eccb2f766e2a81b5afdb98843f7744a33488afe65b42066. +// +// Solidity: event ObjectionRaised(uint256 indexed redemptionKey, address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchObjectionRaised(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerObjectionRaised, redemptionKey []*big.Int, guardian []common.Address) (event.Subscription, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + var guardianRule []interface{} + for _, guardianItem := range guardian { + guardianRule = append(guardianRule, guardianItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "ObjectionRaised", redemptionKeyRule, guardianRule) + 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(RedemptionWatchtowerObjectionRaised) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "ObjectionRaised", 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 +} + +// ParseObjectionRaised is a log parse operation binding the contract event 0x5d8525c7222757376eccb2f766e2a81b5afdb98843f7744a33488afe65b42066. +// +// Solidity: event ObjectionRaised(uint256 indexed redemptionKey, address indexed guardian) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseObjectionRaised(log types.Log) (*RedemptionWatchtowerObjectionRaised, error) { + event := new(RedemptionWatchtowerObjectionRaised) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "ObjectionRaised", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerOwnershipTransferredIterator is returned from FilterOwnershipTransferred and is used to iterate over the raw logs and unpacked data for OwnershipTransferred events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerOwnershipTransferredIterator struct { + Event *RedemptionWatchtowerOwnershipTransferred // 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 *RedemptionWatchtowerOwnershipTransferredIterator) 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(RedemptionWatchtowerOwnershipTransferred) + 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(RedemptionWatchtowerOwnershipTransferred) + 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 *RedemptionWatchtowerOwnershipTransferredIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerOwnershipTransferredIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerOwnershipTransferred represents a OwnershipTransferred event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerOwnershipTransferred 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 (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterOwnershipTransferred(opts *bind.FilterOpts, previousOwner []common.Address, newOwner []common.Address) (*RedemptionWatchtowerOwnershipTransferredIterator, 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 := _RedemptionWatchtower.contract.FilterLogs(opts, "OwnershipTransferred", previousOwnerRule, newOwnerRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerOwnershipTransferredIterator{contract: _RedemptionWatchtower.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 (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchOwnershipTransferred(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerOwnershipTransferred, 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 := _RedemptionWatchtower.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(RedemptionWatchtowerOwnershipTransferred) + if err := _RedemptionWatchtower.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 (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseOwnershipTransferred(log types.Log) (*RedemptionWatchtowerOwnershipTransferred, error) { + event := new(RedemptionWatchtowerOwnershipTransferred) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "OwnershipTransferred", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerUnbannedIterator is returned from FilterUnbanned and is used to iterate over the raw logs and unpacked data for Unbanned events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerUnbannedIterator struct { + Event *RedemptionWatchtowerUnbanned // 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 *RedemptionWatchtowerUnbannedIterator) 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(RedemptionWatchtowerUnbanned) + 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(RedemptionWatchtowerUnbanned) + 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 *RedemptionWatchtowerUnbannedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerUnbannedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerUnbanned represents a Unbanned event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerUnbanned struct { + Redeemer common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterUnbanned is a free log retrieval operation binding the contract event 0x2ab91b53354938415bb6962c4322231cd4cb2c84930f1a4b9abbedc2fe8abe72. +// +// Solidity: event Unbanned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterUnbanned(opts *bind.FilterOpts, redeemer []common.Address) (*RedemptionWatchtowerUnbannedIterator, error) { + + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "Unbanned", redeemerRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerUnbannedIterator{contract: _RedemptionWatchtower.contract, event: "Unbanned", logs: logs, sub: sub}, nil +} + +// WatchUnbanned is a free log subscription operation binding the contract event 0x2ab91b53354938415bb6962c4322231cd4cb2c84930f1a4b9abbedc2fe8abe72. +// +// Solidity: event Unbanned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchUnbanned(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerUnbanned, redeemer []common.Address) (event.Subscription, error) { + + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "Unbanned", redeemerRule) + 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(RedemptionWatchtowerUnbanned) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Unbanned", 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 +} + +// ParseUnbanned is a log parse operation binding the contract event 0x2ab91b53354938415bb6962c4322231cd4cb2c84930f1a4b9abbedc2fe8abe72. +// +// Solidity: event Unbanned(address indexed redeemer) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseUnbanned(log types.Log) (*RedemptionWatchtowerUnbanned, error) { + event := new(RedemptionWatchtowerUnbanned) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "Unbanned", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerVetoFinalizedIterator is returned from FilterVetoFinalized and is used to iterate over the raw logs and unpacked data for VetoFinalized events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoFinalizedIterator struct { + Event *RedemptionWatchtowerVetoFinalized // 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 *RedemptionWatchtowerVetoFinalizedIterator) 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(RedemptionWatchtowerVetoFinalized) + 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(RedemptionWatchtowerVetoFinalized) + 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 *RedemptionWatchtowerVetoFinalizedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerVetoFinalizedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerVetoFinalized represents a VetoFinalized event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoFinalized struct { + RedemptionKey *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVetoFinalized is a free log retrieval operation binding the contract event 0x8eb509395e8a959b0d0589ef622e986b3f49d1da636c2f27dc8a5e92a6625316. +// +// Solidity: event VetoFinalized(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterVetoFinalized(opts *bind.FilterOpts, redemptionKey []*big.Int) (*RedemptionWatchtowerVetoFinalizedIterator, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "VetoFinalized", redemptionKeyRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerVetoFinalizedIterator{contract: _RedemptionWatchtower.contract, event: "VetoFinalized", logs: logs, sub: sub}, nil +} + +// WatchVetoFinalized is a free log subscription operation binding the contract event 0x8eb509395e8a959b0d0589ef622e986b3f49d1da636c2f27dc8a5e92a6625316. +// +// Solidity: event VetoFinalized(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchVetoFinalized(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerVetoFinalized, redemptionKey []*big.Int) (event.Subscription, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "VetoFinalized", redemptionKeyRule) + 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(RedemptionWatchtowerVetoFinalized) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoFinalized", 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 +} + +// ParseVetoFinalized is a log parse operation binding the contract event 0x8eb509395e8a959b0d0589ef622e986b3f49d1da636c2f27dc8a5e92a6625316. +// +// Solidity: event VetoFinalized(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseVetoFinalized(log types.Log) (*RedemptionWatchtowerVetoFinalized, error) { + event := new(RedemptionWatchtowerVetoFinalized) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoFinalized", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerVetoPeriodCheckOmittedIterator is returned from FilterVetoPeriodCheckOmitted and is used to iterate over the raw logs and unpacked data for VetoPeriodCheckOmitted events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoPeriodCheckOmittedIterator struct { + Event *RedemptionWatchtowerVetoPeriodCheckOmitted // 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 *RedemptionWatchtowerVetoPeriodCheckOmittedIterator) 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(RedemptionWatchtowerVetoPeriodCheckOmitted) + 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(RedemptionWatchtowerVetoPeriodCheckOmitted) + 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 *RedemptionWatchtowerVetoPeriodCheckOmittedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerVetoPeriodCheckOmittedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerVetoPeriodCheckOmitted represents a VetoPeriodCheckOmitted event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoPeriodCheckOmitted struct { + RedemptionKey *big.Int + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVetoPeriodCheckOmitted is a free log retrieval operation binding the contract event 0x2d59b29d731ca4ec69587ad0b14c55ab6746d2b1ebf6ae0552d2dbd7dec886df. +// +// Solidity: event VetoPeriodCheckOmitted(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterVetoPeriodCheckOmitted(opts *bind.FilterOpts, redemptionKey []*big.Int) (*RedemptionWatchtowerVetoPeriodCheckOmittedIterator, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "VetoPeriodCheckOmitted", redemptionKeyRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerVetoPeriodCheckOmittedIterator{contract: _RedemptionWatchtower.contract, event: "VetoPeriodCheckOmitted", logs: logs, sub: sub}, nil +} + +// WatchVetoPeriodCheckOmitted is a free log subscription operation binding the contract event 0x2d59b29d731ca4ec69587ad0b14c55ab6746d2b1ebf6ae0552d2dbd7dec886df. +// +// Solidity: event VetoPeriodCheckOmitted(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchVetoPeriodCheckOmitted(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerVetoPeriodCheckOmitted, redemptionKey []*big.Int) (event.Subscription, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "VetoPeriodCheckOmitted", redemptionKeyRule) + 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(RedemptionWatchtowerVetoPeriodCheckOmitted) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoPeriodCheckOmitted", 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 +} + +// ParseVetoPeriodCheckOmitted is a log parse operation binding the contract event 0x2d59b29d731ca4ec69587ad0b14c55ab6746d2b1ebf6ae0552d2dbd7dec886df. +// +// Solidity: event VetoPeriodCheckOmitted(uint256 indexed redemptionKey) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseVetoPeriodCheckOmitted(log types.Log) (*RedemptionWatchtowerVetoPeriodCheckOmitted, error) { + event := new(RedemptionWatchtowerVetoPeriodCheckOmitted) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoPeriodCheckOmitted", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerVetoedFundsWithdrawnIterator is returned from FilterVetoedFundsWithdrawn and is used to iterate over the raw logs and unpacked data for VetoedFundsWithdrawn events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoedFundsWithdrawnIterator struct { + Event *RedemptionWatchtowerVetoedFundsWithdrawn // 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 *RedemptionWatchtowerVetoedFundsWithdrawnIterator) 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(RedemptionWatchtowerVetoedFundsWithdrawn) + 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(RedemptionWatchtowerVetoedFundsWithdrawn) + 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 *RedemptionWatchtowerVetoedFundsWithdrawnIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerVetoedFundsWithdrawnIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerVetoedFundsWithdrawn represents a VetoedFundsWithdrawn event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerVetoedFundsWithdrawn struct { + RedemptionKey *big.Int + Redeemer common.Address + Amount uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterVetoedFundsWithdrawn is a free log retrieval operation binding the contract event 0xd826f2aef2bafd3d282c752ed164de2f4b2b44391c8b123c5c22c7846943f7c2. +// +// Solidity: event VetoedFundsWithdrawn(uint256 indexed redemptionKey, address indexed redeemer, uint64 amount) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterVetoedFundsWithdrawn(opts *bind.FilterOpts, redemptionKey []*big.Int, redeemer []common.Address) (*RedemptionWatchtowerVetoedFundsWithdrawnIterator, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "VetoedFundsWithdrawn", redemptionKeyRule, redeemerRule) + if err != nil { + return nil, err + } + return &RedemptionWatchtowerVetoedFundsWithdrawnIterator{contract: _RedemptionWatchtower.contract, event: "VetoedFundsWithdrawn", logs: logs, sub: sub}, nil +} + +// WatchVetoedFundsWithdrawn is a free log subscription operation binding the contract event 0xd826f2aef2bafd3d282c752ed164de2f4b2b44391c8b123c5c22c7846943f7c2. +// +// Solidity: event VetoedFundsWithdrawn(uint256 indexed redemptionKey, address indexed redeemer, uint64 amount) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchVetoedFundsWithdrawn(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerVetoedFundsWithdrawn, redemptionKey []*big.Int, redeemer []common.Address) (event.Subscription, error) { + + var redemptionKeyRule []interface{} + for _, redemptionKeyItem := range redemptionKey { + redemptionKeyRule = append(redemptionKeyRule, redemptionKeyItem) + } + var redeemerRule []interface{} + for _, redeemerItem := range redeemer { + redeemerRule = append(redeemerRule, redeemerItem) + } + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "VetoedFundsWithdrawn", redemptionKeyRule, redeemerRule) + 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(RedemptionWatchtowerVetoedFundsWithdrawn) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoedFundsWithdrawn", 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 +} + +// ParseVetoedFundsWithdrawn is a log parse operation binding the contract event 0xd826f2aef2bafd3d282c752ed164de2f4b2b44391c8b123c5c22c7846943f7c2. +// +// Solidity: event VetoedFundsWithdrawn(uint256 indexed redemptionKey, address indexed redeemer, uint64 amount) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseVetoedFundsWithdrawn(log types.Log) (*RedemptionWatchtowerVetoedFundsWithdrawn, error) { + event := new(RedemptionWatchtowerVetoedFundsWithdrawn) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "VetoedFundsWithdrawn", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerWatchtowerDisabledIterator is returned from FilterWatchtowerDisabled and is used to iterate over the raw logs and unpacked data for WatchtowerDisabled events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerDisabledIterator struct { + Event *RedemptionWatchtowerWatchtowerDisabled // 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 *RedemptionWatchtowerWatchtowerDisabledIterator) 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(RedemptionWatchtowerWatchtowerDisabled) + 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(RedemptionWatchtowerWatchtowerDisabled) + 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 *RedemptionWatchtowerWatchtowerDisabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerWatchtowerDisabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerWatchtowerDisabled represents a WatchtowerDisabled event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerDisabled struct { + DisabledAt uint32 + Executor common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWatchtowerDisabled is a free log retrieval operation binding the contract event 0x825315723dc33add785ed4b997cbc4559a6c2cfee60833751b22a1f7c83bbe29. +// +// Solidity: event WatchtowerDisabled(uint32 disabledAt, address executor) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterWatchtowerDisabled(opts *bind.FilterOpts) (*RedemptionWatchtowerWatchtowerDisabledIterator, error) { + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "WatchtowerDisabled") + if err != nil { + return nil, err + } + return &RedemptionWatchtowerWatchtowerDisabledIterator{contract: _RedemptionWatchtower.contract, event: "WatchtowerDisabled", logs: logs, sub: sub}, nil +} + +// WatchWatchtowerDisabled is a free log subscription operation binding the contract event 0x825315723dc33add785ed4b997cbc4559a6c2cfee60833751b22a1f7c83bbe29. +// +// Solidity: event WatchtowerDisabled(uint32 disabledAt, address executor) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchWatchtowerDisabled(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerWatchtowerDisabled) (event.Subscription, error) { + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "WatchtowerDisabled") + 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(RedemptionWatchtowerWatchtowerDisabled) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerDisabled", 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 +} + +// ParseWatchtowerDisabled is a log parse operation binding the contract event 0x825315723dc33add785ed4b997cbc4559a6c2cfee60833751b22a1f7c83bbe29. +// +// Solidity: event WatchtowerDisabled(uint32 disabledAt, address executor) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseWatchtowerDisabled(log types.Log) (*RedemptionWatchtowerWatchtowerDisabled, error) { + event := new(RedemptionWatchtowerWatchtowerDisabled) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerDisabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerWatchtowerEnabledIterator is returned from FilterWatchtowerEnabled and is used to iterate over the raw logs and unpacked data for WatchtowerEnabled events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerEnabledIterator struct { + Event *RedemptionWatchtowerWatchtowerEnabled // 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 *RedemptionWatchtowerWatchtowerEnabledIterator) 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(RedemptionWatchtowerWatchtowerEnabled) + 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(RedemptionWatchtowerWatchtowerEnabled) + 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 *RedemptionWatchtowerWatchtowerEnabledIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerWatchtowerEnabledIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerWatchtowerEnabled represents a WatchtowerEnabled event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerEnabled struct { + EnabledAt uint32 + Manager common.Address + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWatchtowerEnabled is a free log retrieval operation binding the contract event 0xb4a5b13ab5dc30d41ccd0e7f76f660f6354b8ddb4c23008ec971f1ef41c7916b. +// +// Solidity: event WatchtowerEnabled(uint32 enabledAt, address manager) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterWatchtowerEnabled(opts *bind.FilterOpts) (*RedemptionWatchtowerWatchtowerEnabledIterator, error) { + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "WatchtowerEnabled") + if err != nil { + return nil, err + } + return &RedemptionWatchtowerWatchtowerEnabledIterator{contract: _RedemptionWatchtower.contract, event: "WatchtowerEnabled", logs: logs, sub: sub}, nil +} + +// WatchWatchtowerEnabled is a free log subscription operation binding the contract event 0xb4a5b13ab5dc30d41ccd0e7f76f660f6354b8ddb4c23008ec971f1ef41c7916b. +// +// Solidity: event WatchtowerEnabled(uint32 enabledAt, address manager) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchWatchtowerEnabled(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerWatchtowerEnabled) (event.Subscription, error) { + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "WatchtowerEnabled") + 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(RedemptionWatchtowerWatchtowerEnabled) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerEnabled", 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 +} + +// ParseWatchtowerEnabled is a log parse operation binding the contract event 0xb4a5b13ab5dc30d41ccd0e7f76f660f6354b8ddb4c23008ec971f1ef41c7916b. +// +// Solidity: event WatchtowerEnabled(uint32 enabledAt, address manager) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseWatchtowerEnabled(log types.Log) (*RedemptionWatchtowerWatchtowerEnabled, error) { + event := new(RedemptionWatchtowerWatchtowerEnabled) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerEnabled", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} + +// RedemptionWatchtowerWatchtowerParametersUpdatedIterator is returned from FilterWatchtowerParametersUpdated and is used to iterate over the raw logs and unpacked data for WatchtowerParametersUpdated events raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerParametersUpdatedIterator struct { + Event *RedemptionWatchtowerWatchtowerParametersUpdated // 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 *RedemptionWatchtowerWatchtowerParametersUpdatedIterator) 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(RedemptionWatchtowerWatchtowerParametersUpdated) + 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(RedemptionWatchtowerWatchtowerParametersUpdated) + 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 *RedemptionWatchtowerWatchtowerParametersUpdatedIterator) Error() error { + return it.fail +} + +// Close terminates the iteration process, releasing any pending underlying +// resources. +func (it *RedemptionWatchtowerWatchtowerParametersUpdatedIterator) Close() error { + it.sub.Unsubscribe() + return nil +} + +// RedemptionWatchtowerWatchtowerParametersUpdated represents a WatchtowerParametersUpdated event raised by the RedemptionWatchtower contract. +type RedemptionWatchtowerWatchtowerParametersUpdated struct { + WatchtowerLifetime uint32 + VetoPenaltyFeeDivisor uint64 + VetoFreezePeriod uint32 + DefaultDelay uint32 + LevelOneDelay uint32 + LevelTwoDelay uint32 + WaivedAmountLimit uint64 + Raw types.Log // Blockchain specific contextual infos +} + +// FilterWatchtowerParametersUpdated is a free log retrieval operation binding the contract event 0x3926935ab567e74893b3e3c7ed329808cfe8db713a1456b29143a0d35b8ac40b. +// +// Solidity: event WatchtowerParametersUpdated(uint32 watchtowerLifetime, uint64 vetoPenaltyFeeDivisor, uint32 vetoFreezePeriod, uint32 defaultDelay, uint32 levelOneDelay, uint32 levelTwoDelay, uint64 waivedAmountLimit) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) FilterWatchtowerParametersUpdated(opts *bind.FilterOpts) (*RedemptionWatchtowerWatchtowerParametersUpdatedIterator, error) { + + logs, sub, err := _RedemptionWatchtower.contract.FilterLogs(opts, "WatchtowerParametersUpdated") + if err != nil { + return nil, err + } + return &RedemptionWatchtowerWatchtowerParametersUpdatedIterator{contract: _RedemptionWatchtower.contract, event: "WatchtowerParametersUpdated", logs: logs, sub: sub}, nil +} + +// WatchWatchtowerParametersUpdated is a free log subscription operation binding the contract event 0x3926935ab567e74893b3e3c7ed329808cfe8db713a1456b29143a0d35b8ac40b. +// +// Solidity: event WatchtowerParametersUpdated(uint32 watchtowerLifetime, uint64 vetoPenaltyFeeDivisor, uint32 vetoFreezePeriod, uint32 defaultDelay, uint32 levelOneDelay, uint32 levelTwoDelay, uint64 waivedAmountLimit) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) WatchWatchtowerParametersUpdated(opts *bind.WatchOpts, sink chan<- *RedemptionWatchtowerWatchtowerParametersUpdated) (event.Subscription, error) { + + logs, sub, err := _RedemptionWatchtower.contract.WatchLogs(opts, "WatchtowerParametersUpdated") + 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(RedemptionWatchtowerWatchtowerParametersUpdated) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerParametersUpdated", 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 +} + +// ParseWatchtowerParametersUpdated is a log parse operation binding the contract event 0x3926935ab567e74893b3e3c7ed329808cfe8db713a1456b29143a0d35b8ac40b. +// +// Solidity: event WatchtowerParametersUpdated(uint32 watchtowerLifetime, uint64 vetoPenaltyFeeDivisor, uint32 vetoFreezePeriod, uint32 defaultDelay, uint32 levelOneDelay, uint32 levelTwoDelay, uint64 waivedAmountLimit) +func (_RedemptionWatchtower *RedemptionWatchtowerFilterer) ParseWatchtowerParametersUpdated(log types.Log) (*RedemptionWatchtowerWatchtowerParametersUpdated, error) { + event := new(RedemptionWatchtowerWatchtowerParametersUpdated) + if err := _RedemptionWatchtower.contract.UnpackLog(event, "WatchtowerParametersUpdated", log); err != nil { + return nil, err + } + event.Raw = log + return event, nil +} diff --git a/pkg/chain/ethereum/tbtc/gen/abi/WalletProposalValidator.go b/pkg/chain/ethereum/tbtc/gen/abi/WalletProposalValidator.go index bef4367894..ed86d98785 100644 --- a/pkg/chain/ethereum/tbtc/gen/abi/WalletProposalValidator.go +++ b/pkg/chain/ethereum/tbtc/gen/abi/WalletProposalValidator.go @@ -26,6 +26,7 @@ var ( _ = common.Big1 _ = types.BloomLookup _ = event.NewSubscription + _ = abi.ConvertType ) // BitcoinTxInfo2 is an auto generated low-level Go binding around an user-defined struct. @@ -72,6 +73,14 @@ type WalletProposalValidatorHeartbeatProposal struct { Message []byte } +// WalletProposalValidatorMovedFundsSweepProposal is an auto generated low-level Go binding around an user-defined struct. +type WalletProposalValidatorMovedFundsSweepProposal struct { + WalletPubKeyHash [20]byte + MovingFundsTxHash [32]byte + MovingFundsTxOutputIndex uint32 + MovedFundsSweepTxFee *big.Int +} + // WalletProposalValidatorMovingFundsProposal is an auto generated low-level Go binding around an user-defined struct. type WalletProposalValidatorMovingFundsProposal struct { WalletPubKeyHash [20]byte @@ -88,7 +97,7 @@ type WalletProposalValidatorRedemptionProposal struct { // WalletProposalValidatorMetaData contains all meta data concerning the WalletProposalValidator contract. var WalletProposalValidatorMetaData = &bind.MetaData{ - ABI: "[{\"inputs\":[{\"internalType\":\"contractBridge\",\"name\":\"_bridge\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DEPOSIT_MIN_AGE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEPOSIT_REFUND_SAFETY_MARGIN\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEPOSIT_SWEEP_MAX_SIZE\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_MAX_SIZE\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_REQUEST_MIN_AGE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_REQUEST_TIMEOUT_SAFETY_MARGIN\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contractBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"fundingTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"}],\"internalType\":\"structWalletProposalValidator.DepositKey[]\",\"name\":\"depositsKeys\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"sweepTxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"depositsRevealBlocks\",\"type\":\"uint256[]\"}],\"internalType\":\"structWalletProposalValidator.DepositSweepProposal\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"}],\"internalType\":\"structWalletProposalValidator.DepositExtraInfo[]\",\"name\":\"depositsExtraInfo\",\"type\":\"tuple[]\"}],\"name\":\"validateDepositSweepProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structWalletProposalValidator.HeartbeatProposal\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"validateHeartbeatProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"},{\"internalType\":\"uint256\",\"name\":\"movingFundsTxFee\",\"type\":\"uint256\"}],\"internalType\":\"structWalletProposalValidator.MovingFundsProposal\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"validateMovingFundsProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes[]\",\"name\":\"redeemersOutputScripts\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"redemptionTxFee\",\"type\":\"uint256\"}],\"internalType\":\"structWalletProposalValidator.RedemptionProposal\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"validateRedemptionProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", + ABI: "[{\"inputs\":[{\"internalType\":\"contractBridge\",\"name\":\"_bridge\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DEPOSIT_MIN_AGE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEPOSIT_REFUND_SAFETY_MARGIN\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"DEPOSIT_SWEEP_MAX_SIZE\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_MAX_SIZE\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_REQUEST_MIN_AGE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"REDEMPTION_REQUEST_TIMEOUT_SAFETY_MARGIN\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"bridge\",\"outputs\":[{\"internalType\":\"contractBridge\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"fundingTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"fundingOutputIndex\",\"type\":\"uint32\"}],\"internalType\":\"structWalletProposalValidator.DepositKey[]\",\"name\":\"depositsKeys\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256\",\"name\":\"sweepTxFee\",\"type\":\"uint256\"},{\"internalType\":\"uint256[]\",\"name\":\"depositsRevealBlocks\",\"type\":\"uint256[]\"}],\"internalType\":\"structWalletProposalValidator.DepositSweepProposal\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"components\":[{\"components\":[{\"internalType\":\"bytes4\",\"name\":\"version\",\"type\":\"bytes4\"},{\"internalType\":\"bytes\",\"name\":\"inputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes\",\"name\":\"outputVector\",\"type\":\"bytes\"},{\"internalType\":\"bytes4\",\"name\":\"locktime\",\"type\":\"bytes4\"}],\"internalType\":\"structBitcoinTx.Info\",\"name\":\"fundingTx\",\"type\":\"tuple\"},{\"internalType\":\"bytes8\",\"name\":\"blindingFactor\",\"type\":\"bytes8\"},{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20\",\"name\":\"refundPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes4\",\"name\":\"refundLocktime\",\"type\":\"bytes4\"}],\"internalType\":\"structWalletProposalValidator.DepositExtraInfo[]\",\"name\":\"depositsExtraInfo\",\"type\":\"tuple[]\"}],\"name\":\"validateDepositSweepProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"internalType\":\"structWalletProposalValidator.HeartbeatProposal\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"validateHeartbeatProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes32\",\"name\":\"movingFundsTxHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"movingFundsTxOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint256\",\"name\":\"movedFundsSweepTxFee\",\"type\":\"uint256\"}],\"internalType\":\"structWalletProposalValidator.MovedFundsSweepProposal\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"validateMovedFundsSweepProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes20[]\",\"name\":\"targetWallets\",\"type\":\"bytes20[]\"},{\"internalType\":\"uint256\",\"name\":\"movingFundsTxFee\",\"type\":\"uint256\"}],\"internalType\":\"structWalletProposalValidator.MovingFundsProposal\",\"name\":\"proposal\",\"type\":\"tuple\"},{\"components\":[{\"internalType\":\"bytes32\",\"name\":\"txHash\",\"type\":\"bytes32\"},{\"internalType\":\"uint32\",\"name\":\"txOutputIndex\",\"type\":\"uint32\"},{\"internalType\":\"uint64\",\"name\":\"txOutputValue\",\"type\":\"uint64\"}],\"internalType\":\"structBitcoinTx.UTXO\",\"name\":\"walletMainUtxo\",\"type\":\"tuple\"}],\"name\":\"validateMovingFundsProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"bytes20\",\"name\":\"walletPubKeyHash\",\"type\":\"bytes20\"},{\"internalType\":\"bytes[]\",\"name\":\"redeemersOutputScripts\",\"type\":\"bytes[]\"},{\"internalType\":\"uint256\",\"name\":\"redemptionTxFee\",\"type\":\"uint256\"}],\"internalType\":\"structWalletProposalValidator.RedemptionProposal\",\"name\":\"proposal\",\"type\":\"tuple\"}],\"name\":\"validateRedemptionProposal\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}]", } // WalletProposalValidatorABI is the input ABI used to generate the binding from. @@ -192,11 +201,11 @@ func NewWalletProposalValidatorFilterer(address common.Address, filterer bind.Co // bindWalletProposalValidator binds a generic wrapper to an already deployed contract. func bindWalletProposalValidator(address common.Address, caller bind.ContractCaller, transactor bind.ContractTransactor, filterer bind.ContractFilterer) (*bind.BoundContract, error) { - parsed, err := abi.JSON(strings.NewReader(WalletProposalValidatorABI)) + parsed, err := WalletProposalValidatorMetaData.GetAbi() if err != nil { return nil, err } - return bind.NewBoundContract(address, parsed, caller, transactor, filterer), nil + return bind.NewBoundContract(address, *parsed, caller, transactor, filterer), nil } // Call invokes the (constant) contract method with params as input values and @@ -516,6 +525,37 @@ func (_WalletProposalValidator *WalletProposalValidatorCallerSession) ValidateHe return _WalletProposalValidator.Contract.ValidateHeartbeatProposal(&_WalletProposalValidator.CallOpts, proposal) } +// ValidateMovedFundsSweepProposal is a free data retrieval call binding the contract method 0xd6c7fa78. +// +// Solidity: function validateMovedFundsSweepProposal((bytes20,bytes32,uint32,uint256) proposal) view returns(bool) +func (_WalletProposalValidator *WalletProposalValidatorCaller) ValidateMovedFundsSweepProposal(opts *bind.CallOpts, proposal WalletProposalValidatorMovedFundsSweepProposal) (bool, error) { + var out []interface{} + err := _WalletProposalValidator.contract.Call(opts, &out, "validateMovedFundsSweepProposal", proposal) + + if err != nil { + return *new(bool), err + } + + out0 := *abi.ConvertType(out[0], new(bool)).(*bool) + + return out0, err + +} + +// ValidateMovedFundsSweepProposal is a free data retrieval call binding the contract method 0xd6c7fa78. +// +// Solidity: function validateMovedFundsSweepProposal((bytes20,bytes32,uint32,uint256) proposal) view returns(bool) +func (_WalletProposalValidator *WalletProposalValidatorSession) ValidateMovedFundsSweepProposal(proposal WalletProposalValidatorMovedFundsSweepProposal) (bool, error) { + return _WalletProposalValidator.Contract.ValidateMovedFundsSweepProposal(&_WalletProposalValidator.CallOpts, proposal) +} + +// ValidateMovedFundsSweepProposal is a free data retrieval call binding the contract method 0xd6c7fa78. +// +// Solidity: function validateMovedFundsSweepProposal((bytes20,bytes32,uint32,uint256) proposal) view returns(bool) +func (_WalletProposalValidator *WalletProposalValidatorCallerSession) ValidateMovedFundsSweepProposal(proposal WalletProposalValidatorMovedFundsSweepProposal) (bool, error) { + return _WalletProposalValidator.Contract.ValidateMovedFundsSweepProposal(&_WalletProposalValidator.CallOpts, proposal) +} + // ValidateMovingFundsProposal is a free data retrieval call binding the contract method 0x9b337db2. // // Solidity: function validateMovingFundsProposal((bytes20,bytes20[],uint256) proposal, (bytes32,uint32,uint64) walletMainUtxo) view returns(bool) diff --git a/pkg/chain/ethereum/tbtc/gen/cmd/Bridge.go b/pkg/chain/ethereum/tbtc/gen/cmd/Bridge.go index b075f066ee..f7a5944669 100644 --- a/pkg/chain/ethereum/tbtc/gen/cmd/Bridge.go +++ b/pkg/chain/ethereum/tbtc/gen/cmd/Bridge.go @@ -58,6 +58,7 @@ func init() { bDepositsCommand(), bFraudChallengesCommand(), bFraudParametersCommand(), + bGetRedemptionWatchtowerCommand(), bGovernanceCommand(), bIsVaultTrustedCommand(), bLiveWalletsCountCommand(), @@ -77,6 +78,7 @@ func init() { bEcdsaWalletHeartbeatFailedCallbackCommand(), bInitializeCommand(), bNotifyMovingFundsBelowDustCommand(), + bNotifyRedemptionVetoCommand(), bNotifyWalletCloseableCommand(), bNotifyWalletClosingPeriodElapsedCommand(), bReceiveBalanceApprovalCommand(), @@ -85,6 +87,7 @@ func init() { bResetMovingFundsTimeoutCommand(), bRevealDepositCommand(), bRevealDepositWithExtraDataCommand(), + bSetRedemptionWatchtowerCommand(), bSetSpvMaintainerStatusCommand(), bSetVaultStatusCommand(), bSubmitDepositSweepProofCommand(), @@ -328,6 +331,40 @@ func bFraudParameters(c *cobra.Command, args []string) error { return nil } +func bGetRedemptionWatchtowerCommand() *cobra.Command { + c := &cobra.Command{ + Use: "get-redemption-watchtower", + Short: "Calls the view method getRedemptionWatchtower on the Bridge contract.", + Args: cmd.ArgCountChecker(0), + RunE: bGetRedemptionWatchtower, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func bGetRedemptionWatchtower(c *cobra.Command, args []string) error { + contract, err := initializeBridge(c) + if err != nil { + return err + } + + result, err := contract.GetRedemptionWatchtowerAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + func bGovernanceCommand() *cobra.Command { c := &cobra.Command{ Use: "governance", @@ -1331,6 +1368,80 @@ func bNotifyMovingFundsBelowDust(c *cobra.Command, args []string) error { return nil } +func bNotifyRedemptionVetoCommand() *cobra.Command { + c := &cobra.Command{ + Use: "notify-redemption-veto [arg_walletPubKeyHash] [arg_redeemerOutputScript]", + Short: "Calls the nonpayable method notifyRedemptionVeto on the Bridge contract.", + Args: cmd.ArgCountChecker(2), + RunE: bNotifyRedemptionVeto, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func bNotifyRedemptionVeto(c *cobra.Command, args []string) error { + contract, err := initializeBridge(c) + if err != nil { + return err + } + + arg_walletPubKeyHash, err := decode.ParseBytes20(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_walletPubKeyHash, a bytes20, from passed value %v", + args[0], + ) + } + arg_redeemerOutputScript, err := hexutil.Decode(args[1]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redeemerOutputScript, a bytes, from passed value %v", + args[1], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.NotifyRedemptionVeto( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallNotifyRedemptionVeto( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + func bNotifyWalletCloseableCommand() *cobra.Command { c := &cobra.Command{ Use: "notify-wallet-closeable [arg_walletPubKeyHash] [arg_walletMainUtxo_json]", @@ -1915,6 +2026,71 @@ func bRevealDepositWithExtraData(c *cobra.Command, args []string) error { return nil } +func bSetRedemptionWatchtowerCommand() *cobra.Command { + c := &cobra.Command{ + Use: "set-redemption-watchtower [arg_redemptionWatchtower]", + Short: "Calls the nonpayable method setRedemptionWatchtower on the Bridge contract.", + Args: cmd.ArgCountChecker(1), + RunE: bSetRedemptionWatchtower, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func bSetRedemptionWatchtower(c *cobra.Command, args []string) error { + contract, err := initializeBridge(c) + if err != nil { + return err + } + + arg_redemptionWatchtower, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redemptionWatchtower, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.SetRedemptionWatchtower( + arg_redemptionWatchtower, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallSetRedemptionWatchtower( + arg_redemptionWatchtower, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + func bSetSpvMaintainerStatusCommand() *cobra.Command { c := &cobra.Command{ Use: "set-spv-maintainer-status [arg_spvMaintainer] [arg_isTrusted]", diff --git a/pkg/chain/ethereum/tbtc/gen/cmd/RedemptionWatchtower.go b/pkg/chain/ethereum/tbtc/gen/cmd/RedemptionWatchtower.go new file mode 100644 index 0000000000..ccbddec189 --- /dev/null +++ b/pkg/chain/ethereum/tbtc/gen/cmd/RedemptionWatchtower.go @@ -0,0 +1,1564 @@ +// Code generated - DO NOT EDIT. +// This file is a generated command and any manual changes will be lost. + +package cmd + +import ( + "context" + "fmt" + "sync" + + "github.com/ethereum/go-ethereum/common/hexutil" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/ethclient" + + chainutil "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/cmd" + "github.com/keep-network/keep-common/pkg/utils/decode" + "github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/contract" + + "github.com/spf13/cobra" +) + +var RedemptionWatchtowerCommand *cobra.Command + +var redemptionWatchtowerDescription = `The redemption-watchtower command allows calling the RedemptionWatchtower contract on an + Ethereum network. It has subcommands corresponding to each contract method, + which respectively each take parameters based on the contract method's + parameters. + + Subcommands will submit a non-mutating call to the network and output the + result. + + All subcommands can be called against a specific block by passing the + -b/--block flag. + + Subcommands for mutating methods may be submitted as a mutating transaction + by passing the -s/--submit flag. In this mode, this command will terminate + successfully once the transaction has been submitted, but will not wait for + the transaction to be included in a block. They return the transaction hash. + + Calls that require ether to be paid will get 0 ether by default, which can + be changed by passing the -v/--value flag.` + +func init() { + RedemptionWatchtowerCommand := &cobra.Command{ + Use: "redemption-watchtower", + Short: `Provides access to the RedemptionWatchtower contract.`, + Long: redemptionWatchtowerDescription, + } + + RedemptionWatchtowerCommand.AddCommand( + rwBankCommand(), + rwBridgeCommand(), + rwDefaultDelayCommand(), + rwGetRedemptionDelayCommand(), + rwIsBannedCommand(), + rwIsGuardianCommand(), + rwIsSafeRedemptionCommand(), + rwLevelOneDelayCommand(), + rwLevelTwoDelayCommand(), + rwManagerCommand(), + rwObjectionsCommand(), + rwOwnerCommand(), + rwVetoFreezePeriodCommand(), + rwVetoPenaltyFeeDivisorCommand(), + rwVetoProposalsCommand(), + rwWaivedAmountLimitCommand(), + rwWatchtowerDisabledAtCommand(), + rwWatchtowerEnabledAtCommand(), + rwWatchtowerLifetimeCommand(), + rwAddGuardianCommand(), + rwDisableWatchtowerCommand(), + rwInitializeCommand(), + rwRaiseObjectionCommand(), + rwRemoveGuardianCommand(), + rwRenounceOwnershipCommand(), + rwTransferOwnershipCommand(), + rwUnbanCommand(), + rwUpdateWatchtowerParametersCommand(), + rwWithdrawVetoedFundsCommand(), + ) + + ModuleCommand.AddCommand(RedemptionWatchtowerCommand) +} + +/// ------------------- Const methods ------------------- + +func rwBankCommand() *cobra.Command { + c := &cobra.Command{ + Use: "bank", + Short: "Calls the view method bank on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwBank, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwBank(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.BankAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwBridgeCommand() *cobra.Command { + c := &cobra.Command{ + Use: "bridge", + Short: "Calls the view method bridge on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwBridge, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwBridge(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.BridgeAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwDefaultDelayCommand() *cobra.Command { + c := &cobra.Command{ + Use: "default-delay", + Short: "Calls the view method defaultDelay on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwDefaultDelay, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwDefaultDelay(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.DefaultDelayAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwGetRedemptionDelayCommand() *cobra.Command { + c := &cobra.Command{ + Use: "get-redemption-delay [arg_redemptionKey]", + Short: "Calls the view method getRedemptionDelay on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwGetRedemptionDelay, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwGetRedemptionDelay(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_redemptionKey, err := hexutil.DecodeBig(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redemptionKey, a uint256, from passed value %v", + args[0], + ) + } + + result, err := contract.GetRedemptionDelayAtBlock( + arg_redemptionKey, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwIsBannedCommand() *cobra.Command { + c := &cobra.Command{ + Use: "is-banned [arg0]", + Short: "Calls the view method isBanned on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwIsBanned, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwIsBanned(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg0, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg0, a address, from passed value %v", + args[0], + ) + } + + result, err := contract.IsBannedAtBlock( + arg0, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwIsGuardianCommand() *cobra.Command { + c := &cobra.Command{ + Use: "is-guardian [arg0]", + Short: "Calls the view method isGuardian on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwIsGuardian, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwIsGuardian(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg0, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg0, a address, from passed value %v", + args[0], + ) + } + + result, err := contract.IsGuardianAtBlock( + arg0, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwIsSafeRedemptionCommand() *cobra.Command { + c := &cobra.Command{ + Use: "is-safe-redemption [arg_walletPubKeyHash] [arg_redeemerOutputScript] [arg_balanceOwner] [arg_redeemer]", + Short: "Calls the view method isSafeRedemption on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(4), + RunE: rwIsSafeRedemption, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwIsSafeRedemption(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_walletPubKeyHash, err := decode.ParseBytes20(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_walletPubKeyHash, a bytes20, from passed value %v", + args[0], + ) + } + arg_redeemerOutputScript, err := hexutil.Decode(args[1]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redeemerOutputScript, a bytes, from passed value %v", + args[1], + ) + } + arg_balanceOwner, err := chainutil.AddressFromHex(args[2]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_balanceOwner, a address, from passed value %v", + args[2], + ) + } + arg_redeemer, err := chainutil.AddressFromHex(args[3]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redeemer, a address, from passed value %v", + args[3], + ) + } + + result, err := contract.IsSafeRedemptionAtBlock( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + arg_balanceOwner, + arg_redeemer, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwLevelOneDelayCommand() *cobra.Command { + c := &cobra.Command{ + Use: "level-one-delay", + Short: "Calls the view method levelOneDelay on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwLevelOneDelay, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwLevelOneDelay(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.LevelOneDelayAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwLevelTwoDelayCommand() *cobra.Command { + c := &cobra.Command{ + Use: "level-two-delay", + Short: "Calls the view method levelTwoDelay on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwLevelTwoDelay, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwLevelTwoDelay(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.LevelTwoDelayAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwManagerCommand() *cobra.Command { + c := &cobra.Command{ + Use: "manager", + Short: "Calls the view method manager on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwManager, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwManager(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.ManagerAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwObjectionsCommand() *cobra.Command { + c := &cobra.Command{ + Use: "objections [arg0]", + Short: "Calls the view method objections on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwObjections, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwObjections(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg0, err := hexutil.DecodeBig(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg0, a uint256, from passed value %v", + args[0], + ) + } + + result, err := contract.ObjectionsAtBlock( + arg0, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwOwnerCommand() *cobra.Command { + c := &cobra.Command{ + Use: "owner", + Short: "Calls the view method owner on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwOwner, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwOwner(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.OwnerAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwVetoFreezePeriodCommand() *cobra.Command { + c := &cobra.Command{ + Use: "veto-freeze-period", + Short: "Calls the view method vetoFreezePeriod on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwVetoFreezePeriod, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwVetoFreezePeriod(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.VetoFreezePeriodAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwVetoPenaltyFeeDivisorCommand() *cobra.Command { + c := &cobra.Command{ + Use: "veto-penalty-fee-divisor", + Short: "Calls the view method vetoPenaltyFeeDivisor on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwVetoPenaltyFeeDivisor, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwVetoPenaltyFeeDivisor(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.VetoPenaltyFeeDivisorAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwVetoProposalsCommand() *cobra.Command { + c := &cobra.Command{ + Use: "veto-proposals [arg0]", + Short: "Calls the view method vetoProposals on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwVetoProposals, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwVetoProposals(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg0, err := hexutil.DecodeBig(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg0, a uint256, from passed value %v", + args[0], + ) + } + + result, err := contract.VetoProposalsAtBlock( + arg0, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwWaivedAmountLimitCommand() *cobra.Command { + c := &cobra.Command{ + Use: "waived-amount-limit", + Short: "Calls the view method waivedAmountLimit on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwWaivedAmountLimit, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwWaivedAmountLimit(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.WaivedAmountLimitAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwWatchtowerDisabledAtCommand() *cobra.Command { + c := &cobra.Command{ + Use: "watchtower-disabled-at", + Short: "Calls the view method watchtowerDisabledAt on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwWatchtowerDisabledAt, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwWatchtowerDisabledAt(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.WatchtowerDisabledAtAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwWatchtowerEnabledAtCommand() *cobra.Command { + c := &cobra.Command{ + Use: "watchtower-enabled-at", + Short: "Calls the view method watchtowerEnabledAt on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwWatchtowerEnabledAt, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwWatchtowerEnabledAt(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.WatchtowerEnabledAtAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +func rwWatchtowerLifetimeCommand() *cobra.Command { + c := &cobra.Command{ + Use: "watchtower-lifetime", + Short: "Calls the view method watchtowerLifetime on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwWatchtowerLifetime, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func rwWatchtowerLifetime(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + result, err := contract.WatchtowerLifetimeAtBlock( + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + +/// ------------------- Non-const methods ------------------- + +func rwAddGuardianCommand() *cobra.Command { + c := &cobra.Command{ + Use: "add-guardian [arg_guardian]", + Short: "Calls the nonpayable method addGuardian on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwAddGuardian, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwAddGuardian(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_guardian, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_guardian, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.AddGuardian( + arg_guardian, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallAddGuardian( + arg_guardian, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwDisableWatchtowerCommand() *cobra.Command { + c := &cobra.Command{ + Use: "disable-watchtower", + Short: "Calls the nonpayable method disableWatchtower on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwDisableWatchtower, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwDisableWatchtower(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.DisableWatchtower() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallDisableWatchtower( + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwInitializeCommand() *cobra.Command { + c := &cobra.Command{ + Use: "initialize [arg__bridge]", + Short: "Calls the nonpayable method initialize on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwInitialize, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwInitialize(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg__bridge, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__bridge, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.Initialize( + arg__bridge, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallInitialize( + arg__bridge, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwRaiseObjectionCommand() *cobra.Command { + c := &cobra.Command{ + Use: "raise-objection [arg_walletPubKeyHash] [arg_redeemerOutputScript]", + Short: "Calls the nonpayable method raiseObjection on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(2), + RunE: rwRaiseObjection, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwRaiseObjection(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_walletPubKeyHash, err := decode.ParseBytes20(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_walletPubKeyHash, a bytes20, from passed value %v", + args[0], + ) + } + arg_redeemerOutputScript, err := hexutil.Decode(args[1]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redeemerOutputScript, a bytes, from passed value %v", + args[1], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.RaiseObjection( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallRaiseObjection( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwRemoveGuardianCommand() *cobra.Command { + c := &cobra.Command{ + Use: "remove-guardian [arg_guardian]", + Short: "Calls the nonpayable method removeGuardian on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwRemoveGuardian, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwRemoveGuardian(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_guardian, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_guardian, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.RemoveGuardian( + arg_guardian, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallRemoveGuardian( + arg_guardian, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwRenounceOwnershipCommand() *cobra.Command { + c := &cobra.Command{ + Use: "renounce-ownership", + Short: "Calls the nonpayable method renounceOwnership on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(0), + RunE: rwRenounceOwnership, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwRenounceOwnership(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.RenounceOwnership() + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallRenounceOwnership( + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwTransferOwnershipCommand() *cobra.Command { + c := &cobra.Command{ + Use: "transfer-ownership [arg_newOwner]", + Short: "Calls the nonpayable method transferOwnership on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwTransferOwnership, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwTransferOwnership(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_newOwner, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_newOwner, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.TransferOwnership( + arg_newOwner, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallTransferOwnership( + arg_newOwner, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwUnbanCommand() *cobra.Command { + c := &cobra.Command{ + Use: "unban [arg_redeemer]", + Short: "Calls the nonpayable method unban on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwUnban, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwUnban(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_redeemer, err := chainutil.AddressFromHex(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redeemer, a address, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.Unban( + arg_redeemer, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallUnban( + arg_redeemer, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwUpdateWatchtowerParametersCommand() *cobra.Command { + c := &cobra.Command{ + Use: "update-watchtower-parameters [arg__watchtowerLifetime] [arg__vetoPenaltyFeeDivisor] [arg__vetoFreezePeriod] [arg__defaultDelay] [arg__levelOneDelay] [arg__levelTwoDelay] [arg__waivedAmountLimit]", + Short: "Calls the nonpayable method updateWatchtowerParameters on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(7), + RunE: rwUpdateWatchtowerParameters, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwUpdateWatchtowerParameters(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg__watchtowerLifetime, err := decode.ParseUint[uint32](args[0], 32) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__watchtowerLifetime, a uint32, from passed value %v", + args[0], + ) + } + arg__vetoPenaltyFeeDivisor, err := decode.ParseUint[uint64](args[1], 64) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__vetoPenaltyFeeDivisor, a uint64, from passed value %v", + args[1], + ) + } + arg__vetoFreezePeriod, err := decode.ParseUint[uint32](args[2], 32) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__vetoFreezePeriod, a uint32, from passed value %v", + args[2], + ) + } + arg__defaultDelay, err := decode.ParseUint[uint32](args[3], 32) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__defaultDelay, a uint32, from passed value %v", + args[3], + ) + } + arg__levelOneDelay, err := decode.ParseUint[uint32](args[4], 32) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__levelOneDelay, a uint32, from passed value %v", + args[4], + ) + } + arg__levelTwoDelay, err := decode.ParseUint[uint32](args[5], 32) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__levelTwoDelay, a uint32, from passed value %v", + args[5], + ) + } + arg__waivedAmountLimit, err := decode.ParseUint[uint64](args[6], 64) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg__waivedAmountLimit, a uint64, from passed value %v", + args[6], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.UpdateWatchtowerParameters( + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallUpdateWatchtowerParameters( + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +func rwWithdrawVetoedFundsCommand() *cobra.Command { + c := &cobra.Command{ + Use: "withdraw-vetoed-funds [arg_redemptionKey]", + Short: "Calls the nonpayable method withdrawVetoedFunds on the RedemptionWatchtower contract.", + Args: cmd.ArgCountChecker(1), + RunE: rwWithdrawVetoedFunds, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + c.PreRunE = cmd.NonConstArgsChecker + cmd.InitNonConstFlags(c) + + return c +} + +func rwWithdrawVetoedFunds(c *cobra.Command, args []string) error { + contract, err := initializeRedemptionWatchtower(c) + if err != nil { + return err + } + + arg_redemptionKey, err := hexutil.DecodeBig(args[0]) + if err != nil { + return fmt.Errorf( + "couldn't parse parameter arg_redemptionKey, a uint256, from passed value %v", + args[0], + ) + } + + var ( + transaction *types.Transaction + ) + + if shouldSubmit, _ := c.Flags().GetBool(cmd.SubmitFlag); shouldSubmit { + // Do a regular submission. Take payable into account. + transaction, err = contract.WithdrawVetoedFunds( + arg_redemptionKey, + ) + if err != nil { + return err + } + + cmd.PrintOutput(transaction.Hash()) + } else { + // Do a call. + err = contract.CallWithdrawVetoedFunds( + arg_redemptionKey, + cmd.BlockFlagValue.Int, + ) + if err != nil { + return err + } + + cmd.PrintOutput("success") + + cmd.PrintOutput( + "the transaction was not submitted to the chain; " + + "please add the `--submit` flag", + ) + } + + return nil +} + +/// ------------------- Initialization ------------------- + +func initializeRedemptionWatchtower(c *cobra.Command) (*contract.RedemptionWatchtower, error) { + cfg := *ModuleCommand.GetConfig() + + client, err := ethclient.Dial(cfg.URL) + if err != nil { + return nil, fmt.Errorf("error connecting to host chain node: [%v]", err) + } + + chainID, err := client.ChainID(context.Background()) + if err != nil { + return nil, fmt.Errorf( + "failed to resolve host chain id: [%v]", + err, + ) + } + + key, err := chainutil.DecryptKeyFile( + cfg.Account.KeyFile, + cfg.Account.KeyFilePassword, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to read KeyFile: %s: [%v]", + cfg.Account.KeyFile, + err, + ) + } + + miningWaiter := chainutil.NewMiningWaiter(client, cfg) + + blockCounter, err := chainutil.NewBlockCounter(client) + if err != nil { + return nil, fmt.Errorf( + "failed to create block counter: [%v]", + err, + ) + } + + address, err := cfg.ContractAddress("RedemptionWatchtower") + if err != nil { + return nil, fmt.Errorf( + "failed to get %s address: [%w]", + "RedemptionWatchtower", + err, + ) + } + + return contract.NewRedemptionWatchtower( + address, + chainID, + key, + client, + chainutil.NewNonceManager(client, key.Address), + miningWaiter, + blockCounter, + &sync.Mutex{}, + ) +} diff --git a/pkg/chain/ethereum/tbtc/gen/cmd/WalletProposalValidator.go b/pkg/chain/ethereum/tbtc/gen/cmd/WalletProposalValidator.go index 1f20214553..d86d97458f 100644 --- a/pkg/chain/ethereum/tbtc/gen/cmd/WalletProposalValidator.go +++ b/pkg/chain/ethereum/tbtc/gen/cmd/WalletProposalValidator.go @@ -56,6 +56,7 @@ func init() { wpvREDEMPTIONREQUESTMINAGECommand(), wpvREDEMPTIONREQUESTTIMEOUTSAFETYMARGINCommand(), wpvValidateHeartbeatProposalCommand(), + wpvValidateMovedFundsSweepProposalCommand(), wpvValidateMovingFundsProposalCommand(), wpvValidateRedemptionProposalCommand(), ) @@ -343,6 +344,46 @@ func wpvValidateHeartbeatProposal(c *cobra.Command, args []string) error { return nil } +func wpvValidateMovedFundsSweepProposalCommand() *cobra.Command { + c := &cobra.Command{ + Use: "validate-moved-funds-sweep-proposal [arg_proposal_json]", + Short: "Calls the view method validateMovedFundsSweepProposal on the WalletProposalValidator contract.", + Args: cmd.ArgCountChecker(1), + RunE: wpvValidateMovedFundsSweepProposal, + SilenceUsage: true, + DisableFlagsInUseLine: true, + } + + cmd.InitConstFlags(c) + + return c +} + +func wpvValidateMovedFundsSweepProposal(c *cobra.Command, args []string) error { + contract, err := initializeWalletProposalValidator(c) + if err != nil { + return err + } + + arg_proposal_json := abi.WalletProposalValidatorMovedFundsSweepProposal{} + if err := json.Unmarshal([]byte(args[0]), &arg_proposal_json); err != nil { + return fmt.Errorf("failed to unmarshal arg_proposal_json to abi.WalletProposalValidatorMovedFundsSweepProposal: %w", err) + } + + result, err := contract.ValidateMovedFundsSweepProposalAtBlock( + arg_proposal_json, + cmd.BlockFlagValue.Int, + ) + + if err != nil { + return err + } + + cmd.PrintOutput(result) + + return nil +} + func wpvValidateMovingFundsProposalCommand() *cobra.Command { c := &cobra.Command{ Use: "validate-moving-funds-proposal [arg_proposal_json] [arg_walletMainUtxo_json]", diff --git a/pkg/chain/ethereum/tbtc/gen/contract/Bridge.go b/pkg/chain/ethereum/tbtc/gen/contract/Bridge.go index c660e23ee7..ae73c92607 100644 --- a/pkg/chain/ethereum/tbtc/gen/contract/Bridge.go +++ b/pkg/chain/ethereum/tbtc/gen/contract/Bridge.go @@ -1684,6 +1684,154 @@ func (b *Bridge) NotifyRedemptionTimeoutGasEstimate( return result, err } +// Transaction submission. +func (b *Bridge) NotifyRedemptionVeto( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + bLogger.Debug( + "submitting transaction notifyRedemptionVeto", + " params: ", + fmt.Sprint( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ), + ) + + b.transactionMutex.Lock() + defer b.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *b.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := b.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := b.contract.NotifyRedemptionVeto( + transactorOptions, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return transaction, b.errorResolver.ResolveError( + err, + b.transactorOptions.From, + nil, + "notifyRedemptionVeto", + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + } + + bLogger.Infof( + "submitted transaction notifyRedemptionVeto with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go b.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := b.contract.NotifyRedemptionVeto( + newTransactorOptions, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return nil, b.errorResolver.ResolveError( + err, + b.transactorOptions.From, + nil, + "notifyRedemptionVeto", + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + } + + bLogger.Infof( + "submitted transaction notifyRedemptionVeto with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + b.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (b *Bridge) CallNotifyRedemptionVeto( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + b.transactorOptions.From, + blockNumber, nil, + b.contractABI, + b.caller, + b.errorResolver, + b.contractAddress, + "notifyRedemptionVeto", + &result, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + + return err +} + +func (b *Bridge) NotifyRedemptionVetoGasEstimate( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + b.callerOptions.From, + b.contractAddress, + "notifyRedemptionVeto", + b.contractABI, + b.transactor, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + + return result, err +} + // Transaction submission. func (b *Bridge) NotifyWalletCloseable( arg_walletPubKeyHash [20]byte, @@ -2878,6 +3026,144 @@ func (b *Bridge) RevealDepositWithExtraDataGasEstimate( return result, err } +// Transaction submission. +func (b *Bridge) SetRedemptionWatchtower( + arg_redemptionWatchtower common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + bLogger.Debug( + "submitting transaction setRedemptionWatchtower", + " params: ", + fmt.Sprint( + arg_redemptionWatchtower, + ), + ) + + b.transactionMutex.Lock() + defer b.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *b.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := b.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := b.contract.SetRedemptionWatchtower( + transactorOptions, + arg_redemptionWatchtower, + ) + if err != nil { + return transaction, b.errorResolver.ResolveError( + err, + b.transactorOptions.From, + nil, + "setRedemptionWatchtower", + arg_redemptionWatchtower, + ) + } + + bLogger.Infof( + "submitted transaction setRedemptionWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go b.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := b.contract.SetRedemptionWatchtower( + newTransactorOptions, + arg_redemptionWatchtower, + ) + if err != nil { + return nil, b.errorResolver.ResolveError( + err, + b.transactorOptions.From, + nil, + "setRedemptionWatchtower", + arg_redemptionWatchtower, + ) + } + + bLogger.Infof( + "submitted transaction setRedemptionWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + b.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (b *Bridge) CallSetRedemptionWatchtower( + arg_redemptionWatchtower common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + b.transactorOptions.From, + blockNumber, nil, + b.contractABI, + b.caller, + b.errorResolver, + b.contractAddress, + "setRedemptionWatchtower", + &result, + arg_redemptionWatchtower, + ) + + return err +} + +func (b *Bridge) SetRedemptionWatchtowerGasEstimate( + arg_redemptionWatchtower common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + b.callerOptions.From, + b.contractAddress, + "setRedemptionWatchtower", + b.contractABI, + b.transactor, + arg_redemptionWatchtower, + ) + + return result, err +} + // Transaction submission. func (b *Bridge) SetSpvMaintainerStatus( arg_spvMaintainer common.Address, @@ -5675,6 +5961,43 @@ func (b *Bridge) FraudParametersAtBlock( return result, err } +func (b *Bridge) GetRedemptionWatchtower() (common.Address, error) { + result, err := b.contract.GetRedemptionWatchtower( + b.callerOptions, + ) + + if err != nil { + return result, b.errorResolver.ResolveError( + err, + b.callerOptions.From, + nil, + "getRedemptionWatchtower", + ) + } + + return result, err +} + +func (b *Bridge) GetRedemptionWatchtowerAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := chainutil.CallAtBlock( + b.callerOptions.From, + blockNumber, + nil, + b.contractABI, + b.caller, + b.errorResolver, + b.contractAddress, + "getRedemptionWatchtower", + &result, + ) + + return result, err +} + func (b *Bridge) Governance() (common.Address, error) { result, err := b.contract.Governance( b.callerOptions, @@ -10419,6 +10742,185 @@ func (b *Bridge) PastRedemptionTimedOutEvents( return events, nil } +func (b *Bridge) RedemptionWatchtowerSetEvent( + opts *ethereum.SubscribeOpts, +) *BRedemptionWatchtowerSetSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &BRedemptionWatchtowerSetSubscription{ + b, + opts, + } +} + +type BRedemptionWatchtowerSetSubscription struct { + contract *Bridge + opts *ethereum.SubscribeOpts +} + +type bridgeRedemptionWatchtowerSetFunc func( + RedemptionWatchtower common.Address, + blockNumber uint64, +) + +func (rwss *BRedemptionWatchtowerSetSubscription) OnEvent( + handler bridgeRedemptionWatchtowerSetFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.BridgeRedemptionWatchtowerSet) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.RedemptionWatchtower, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := rwss.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rwss *BRedemptionWatchtowerSetSubscription) Pipe( + sink chan *abi.BridgeRedemptionWatchtowerSet, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(rwss.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := rwss.contract.blockCounter.CurrentBlock() + if err != nil { + bLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - rwss.opts.PastBlocks + + bLogger.Infof( + "subscription monitoring fetching past RedemptionWatchtowerSet events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := rwss.contract.PastRedemptionWatchtowerSetEvents( + fromBlock, + nil, + ) + if err != nil { + bLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + bLogger.Infof( + "subscription monitoring fetched [%v] past RedemptionWatchtowerSet events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := rwss.contract.watchRedemptionWatchtowerSet( + sink, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (b *Bridge) watchRedemptionWatchtowerSet( + sink chan *abi.BridgeRedemptionWatchtowerSet, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return b.contract.WatchRedemptionWatchtowerSet( + &bind.WatchOpts{Context: ctx}, + sink, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + bLogger.Warnf( + "subscription to event RedemptionWatchtowerSet had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + bLogger.Errorf( + "subscription to event RedemptionWatchtowerSet failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (b *Bridge) PastRedemptionWatchtowerSetEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.BridgeRedemptionWatchtowerSet, error) { + iterator, err := b.contract.FilterRedemptionWatchtowerSet( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past RedemptionWatchtowerSet events: [%v]", + err, + ) + } + + events := make([]*abi.BridgeRedemptionWatchtowerSet, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + func (b *Bridge) RedemptionsCompletedEvent( opts *ethereum.SubscribeOpts, walletPubKeyHashFilter [][20]byte, diff --git a/pkg/chain/ethereum/tbtc/gen/contract/RedemptionWatchtower.go b/pkg/chain/ethereum/tbtc/gen/contract/RedemptionWatchtower.go new file mode 100644 index 0000000000..9e49a30418 --- /dev/null +++ b/pkg/chain/ethereum/tbtc/gen/contract/RedemptionWatchtower.go @@ -0,0 +1,4899 @@ +// Code generated - DO NOT EDIT. +// This file is a generated binding and any manual changes will be lost. + +package contract + +import ( + "context" + "fmt" + "math/big" + "strings" + "sync" + "time" + + hostchainabi "github.com/ethereum/go-ethereum/accounts/abi" + "github.com/ethereum/go-ethereum/accounts/abi/bind" + "github.com/ethereum/go-ethereum/accounts/keystore" + "github.com/ethereum/go-ethereum/common" + "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/event" + + "github.com/ipfs/go-log" + + "github.com/keep-network/keep-common/pkg/chain/ethereum" + chainutil "github.com/keep-network/keep-common/pkg/chain/ethereum/ethutil" + "github.com/keep-network/keep-common/pkg/subscription" + "github.com/keep-network/keep-core/pkg/chain/ethereum/tbtc/gen/abi" +) + +// Create a package-level logger for this contract. The logger exists at +// package level so that the logger is registered at startup and can be +// included or excluded from logging at startup by name. +var rwLogger = log.Logger("keep-contract-RedemptionWatchtower") + +type RedemptionWatchtower struct { + contract *abi.RedemptionWatchtower + contractAddress common.Address + contractABI *hostchainabi.ABI + caller bind.ContractCaller + transactor bind.ContractTransactor + callerOptions *bind.CallOpts + transactorOptions *bind.TransactOpts + errorResolver *chainutil.ErrorResolver + nonceManager *ethereum.NonceManager + miningWaiter *chainutil.MiningWaiter + blockCounter *ethereum.BlockCounter + + transactionMutex *sync.Mutex +} + +func NewRedemptionWatchtower( + contractAddress common.Address, + chainId *big.Int, + accountKey *keystore.Key, + backend bind.ContractBackend, + nonceManager *ethereum.NonceManager, + miningWaiter *chainutil.MiningWaiter, + blockCounter *ethereum.BlockCounter, + transactionMutex *sync.Mutex, +) (*RedemptionWatchtower, error) { + callerOptions := &bind.CallOpts{ + From: accountKey.Address, + } + + transactorOptions, err := bind.NewKeyedTransactorWithChainID( + accountKey.PrivateKey, + chainId, + ) + if err != nil { + return nil, fmt.Errorf("failed to instantiate transactor: [%v]", err) + } + + contract, err := abi.NewRedemptionWatchtower( + contractAddress, + backend, + ) + if err != nil { + return nil, fmt.Errorf( + "failed to instantiate contract at address: %s [%v]", + contractAddress.String(), + err, + ) + } + + contractABI, err := hostchainabi.JSON(strings.NewReader(abi.RedemptionWatchtowerABI)) + if err != nil { + return nil, fmt.Errorf("failed to instantiate ABI: [%v]", err) + } + + return &RedemptionWatchtower{ + contract: contract, + contractAddress: contractAddress, + contractABI: &contractABI, + caller: backend, + transactor: backend, + callerOptions: callerOptions, + transactorOptions: transactorOptions, + errorResolver: chainutil.NewErrorResolver(backend, &contractABI, &contractAddress), + nonceManager: nonceManager, + miningWaiter: miningWaiter, + blockCounter: blockCounter, + transactionMutex: transactionMutex, + }, nil +} + +// ----- Non-const Methods ------ + +// Transaction submission. +func (rw *RedemptionWatchtower) AddGuardian( + arg_guardian common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction addGuardian", + " params: ", + fmt.Sprint( + arg_guardian, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.AddGuardian( + transactorOptions, + arg_guardian, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "addGuardian", + arg_guardian, + ) + } + + rwLogger.Infof( + "submitted transaction addGuardian with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.AddGuardian( + newTransactorOptions, + arg_guardian, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "addGuardian", + arg_guardian, + ) + } + + rwLogger.Infof( + "submitted transaction addGuardian with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallAddGuardian( + arg_guardian common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "addGuardian", + &result, + arg_guardian, + ) + + return err +} + +func (rw *RedemptionWatchtower) AddGuardianGasEstimate( + arg_guardian common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "addGuardian", + rw.contractABI, + rw.transactor, + arg_guardian, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) DisableWatchtower( + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction disableWatchtower", + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.DisableWatchtower( + transactorOptions, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "disableWatchtower", + ) + } + + rwLogger.Infof( + "submitted transaction disableWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.DisableWatchtower( + newTransactorOptions, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "disableWatchtower", + ) + } + + rwLogger.Infof( + "submitted transaction disableWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallDisableWatchtower( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "disableWatchtower", + &result, + ) + + return err +} + +func (rw *RedemptionWatchtower) DisableWatchtowerGasEstimate() (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "disableWatchtower", + rw.contractABI, + rw.transactor, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) EnableWatchtower( + arg__manager common.Address, + arg__guardians []common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction enableWatchtower", + " params: ", + fmt.Sprint( + arg__manager, + arg__guardians, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.EnableWatchtower( + transactorOptions, + arg__manager, + arg__guardians, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "enableWatchtower", + arg__manager, + arg__guardians, + ) + } + + rwLogger.Infof( + "submitted transaction enableWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.EnableWatchtower( + newTransactorOptions, + arg__manager, + arg__guardians, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "enableWatchtower", + arg__manager, + arg__guardians, + ) + } + + rwLogger.Infof( + "submitted transaction enableWatchtower with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallEnableWatchtower( + arg__manager common.Address, + arg__guardians []common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "enableWatchtower", + &result, + arg__manager, + arg__guardians, + ) + + return err +} + +func (rw *RedemptionWatchtower) EnableWatchtowerGasEstimate( + arg__manager common.Address, + arg__guardians []common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "enableWatchtower", + rw.contractABI, + rw.transactor, + arg__manager, + arg__guardians, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) Initialize( + arg__bridge common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction initialize", + " params: ", + fmt.Sprint( + arg__bridge, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.Initialize( + transactorOptions, + arg__bridge, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "initialize", + arg__bridge, + ) + } + + rwLogger.Infof( + "submitted transaction initialize with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.Initialize( + newTransactorOptions, + arg__bridge, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "initialize", + arg__bridge, + ) + } + + rwLogger.Infof( + "submitted transaction initialize with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallInitialize( + arg__bridge common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "initialize", + &result, + arg__bridge, + ) + + return err +} + +func (rw *RedemptionWatchtower) InitializeGasEstimate( + arg__bridge common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "initialize", + rw.contractABI, + rw.transactor, + arg__bridge, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) RaiseObjection( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction raiseObjection", + " params: ", + fmt.Sprint( + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.RaiseObjection( + transactorOptions, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "raiseObjection", + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + } + + rwLogger.Infof( + "submitted transaction raiseObjection with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.RaiseObjection( + newTransactorOptions, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "raiseObjection", + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + } + + rwLogger.Infof( + "submitted transaction raiseObjection with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallRaiseObjection( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "raiseObjection", + &result, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + + return err +} + +func (rw *RedemptionWatchtower) RaiseObjectionGasEstimate( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "raiseObjection", + rw.contractABI, + rw.transactor, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) RemoveGuardian( + arg_guardian common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction removeGuardian", + " params: ", + fmt.Sprint( + arg_guardian, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.RemoveGuardian( + transactorOptions, + arg_guardian, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "removeGuardian", + arg_guardian, + ) + } + + rwLogger.Infof( + "submitted transaction removeGuardian with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.RemoveGuardian( + newTransactorOptions, + arg_guardian, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "removeGuardian", + arg_guardian, + ) + } + + rwLogger.Infof( + "submitted transaction removeGuardian with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallRemoveGuardian( + arg_guardian common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "removeGuardian", + &result, + arg_guardian, + ) + + return err +} + +func (rw *RedemptionWatchtower) RemoveGuardianGasEstimate( + arg_guardian common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "removeGuardian", + rw.contractABI, + rw.transactor, + arg_guardian, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) RenounceOwnership( + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction renounceOwnership", + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.RenounceOwnership( + transactorOptions, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + rwLogger.Infof( + "submitted transaction renounceOwnership with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.RenounceOwnership( + newTransactorOptions, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "renounceOwnership", + ) + } + + rwLogger.Infof( + "submitted transaction renounceOwnership with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallRenounceOwnership( + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "renounceOwnership", + &result, + ) + + return err +} + +func (rw *RedemptionWatchtower) RenounceOwnershipGasEstimate() (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "renounceOwnership", + rw.contractABI, + rw.transactor, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) TransferOwnership( + arg_newOwner common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction transferOwnership", + " params: ", + fmt.Sprint( + arg_newOwner, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.TransferOwnership( + transactorOptions, + arg_newOwner, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "transferOwnership", + arg_newOwner, + ) + } + + rwLogger.Infof( + "submitted transaction transferOwnership with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.TransferOwnership( + newTransactorOptions, + arg_newOwner, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "transferOwnership", + arg_newOwner, + ) + } + + rwLogger.Infof( + "submitted transaction transferOwnership with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallTransferOwnership( + arg_newOwner common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "transferOwnership", + &result, + arg_newOwner, + ) + + return err +} + +func (rw *RedemptionWatchtower) TransferOwnershipGasEstimate( + arg_newOwner common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "transferOwnership", + rw.contractABI, + rw.transactor, + arg_newOwner, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) Unban( + arg_redeemer common.Address, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction unban", + " params: ", + fmt.Sprint( + arg_redeemer, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.Unban( + transactorOptions, + arg_redeemer, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "unban", + arg_redeemer, + ) + } + + rwLogger.Infof( + "submitted transaction unban with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.Unban( + newTransactorOptions, + arg_redeemer, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "unban", + arg_redeemer, + ) + } + + rwLogger.Infof( + "submitted transaction unban with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallUnban( + arg_redeemer common.Address, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "unban", + &result, + arg_redeemer, + ) + + return err +} + +func (rw *RedemptionWatchtower) UnbanGasEstimate( + arg_redeemer common.Address, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "unban", + rw.contractABI, + rw.transactor, + arg_redeemer, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) UpdateWatchtowerParameters( + arg__watchtowerLifetime uint32, + arg__vetoPenaltyFeeDivisor uint64, + arg__vetoFreezePeriod uint32, + arg__defaultDelay uint32, + arg__levelOneDelay uint32, + arg__levelTwoDelay uint32, + arg__waivedAmountLimit uint64, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction updateWatchtowerParameters", + " params: ", + fmt.Sprint( + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.UpdateWatchtowerParameters( + transactorOptions, + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "updateWatchtowerParameters", + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + } + + rwLogger.Infof( + "submitted transaction updateWatchtowerParameters with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.UpdateWatchtowerParameters( + newTransactorOptions, + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "updateWatchtowerParameters", + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + } + + rwLogger.Infof( + "submitted transaction updateWatchtowerParameters with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallUpdateWatchtowerParameters( + arg__watchtowerLifetime uint32, + arg__vetoPenaltyFeeDivisor uint64, + arg__vetoFreezePeriod uint32, + arg__defaultDelay uint32, + arg__levelOneDelay uint32, + arg__levelTwoDelay uint32, + arg__waivedAmountLimit uint64, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "updateWatchtowerParameters", + &result, + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + + return err +} + +func (rw *RedemptionWatchtower) UpdateWatchtowerParametersGasEstimate( + arg__watchtowerLifetime uint32, + arg__vetoPenaltyFeeDivisor uint64, + arg__vetoFreezePeriod uint32, + arg__defaultDelay uint32, + arg__levelOneDelay uint32, + arg__levelTwoDelay uint32, + arg__waivedAmountLimit uint64, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "updateWatchtowerParameters", + rw.contractABI, + rw.transactor, + arg__watchtowerLifetime, + arg__vetoPenaltyFeeDivisor, + arg__vetoFreezePeriod, + arg__defaultDelay, + arg__levelOneDelay, + arg__levelTwoDelay, + arg__waivedAmountLimit, + ) + + return result, err +} + +// Transaction submission. +func (rw *RedemptionWatchtower) WithdrawVetoedFunds( + arg_redemptionKey *big.Int, + + transactionOptions ...chainutil.TransactionOptions, +) (*types.Transaction, error) { + rwLogger.Debug( + "submitting transaction withdrawVetoedFunds", + " params: ", + fmt.Sprint( + arg_redemptionKey, + ), + ) + + rw.transactionMutex.Lock() + defer rw.transactionMutex.Unlock() + + // create a copy + transactorOptions := new(bind.TransactOpts) + *transactorOptions = *rw.transactorOptions + + if len(transactionOptions) > 1 { + return nil, fmt.Errorf( + "could not process multiple transaction options sets", + ) + } else if len(transactionOptions) > 0 { + transactionOptions[0].Apply(transactorOptions) + } + + nonce, err := rw.nonceManager.CurrentNonce() + if err != nil { + return nil, fmt.Errorf("failed to retrieve account nonce: %v", err) + } + + transactorOptions.Nonce = new(big.Int).SetUint64(nonce) + + transaction, err := rw.contract.WithdrawVetoedFunds( + transactorOptions, + arg_redemptionKey, + ) + if err != nil { + return transaction, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "withdrawVetoedFunds", + arg_redemptionKey, + ) + } + + rwLogger.Infof( + "submitted transaction withdrawVetoedFunds with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + go rw.miningWaiter.ForceMining( + transaction, + transactorOptions, + func(newTransactorOptions *bind.TransactOpts) (*types.Transaction, error) { + // If original transactor options has a non-zero gas limit, that + // means the client code set it on their own. In that case, we + // should rewrite the gas limit from the original transaction + // for each resubmission. If the gas limit is not set by the client + // code, let the the submitter re-estimate the gas limit on each + // resubmission. + if transactorOptions.GasLimit != 0 { + newTransactorOptions.GasLimit = transactorOptions.GasLimit + } + + transaction, err := rw.contract.WithdrawVetoedFunds( + newTransactorOptions, + arg_redemptionKey, + ) + if err != nil { + return nil, rw.errorResolver.ResolveError( + err, + rw.transactorOptions.From, + nil, + "withdrawVetoedFunds", + arg_redemptionKey, + ) + } + + rwLogger.Infof( + "submitted transaction withdrawVetoedFunds with id: [%s] and nonce [%v]", + transaction.Hash(), + transaction.Nonce(), + ) + + return transaction, nil + }, + ) + + rw.nonceManager.IncrementNonce() + + return transaction, err +} + +// Non-mutating call, not a transaction submission. +func (rw *RedemptionWatchtower) CallWithdrawVetoedFunds( + arg_redemptionKey *big.Int, + blockNumber *big.Int, +) error { + var result interface{} = nil + + err := chainutil.CallAtBlock( + rw.transactorOptions.From, + blockNumber, nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "withdrawVetoedFunds", + &result, + arg_redemptionKey, + ) + + return err +} + +func (rw *RedemptionWatchtower) WithdrawVetoedFundsGasEstimate( + arg_redemptionKey *big.Int, +) (uint64, error) { + var result uint64 + + result, err := chainutil.EstimateGas( + rw.callerOptions.From, + rw.contractAddress, + "withdrawVetoedFunds", + rw.contractABI, + rw.transactor, + arg_redemptionKey, + ) + + return result, err +} + +// ----- Const Methods ------ + +func (rw *RedemptionWatchtower) Bank() (common.Address, error) { + result, err := rw.contract.Bank( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "bank", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) BankAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "bank", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) Bridge() (common.Address, error) { + result, err := rw.contract.Bridge( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "bridge", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) BridgeAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "bridge", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) DefaultDelay() (uint32, error) { + result, err := rw.contract.DefaultDelay( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "defaultDelay", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) DefaultDelayAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "defaultDelay", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) GetRedemptionDelay( + arg_redemptionKey *big.Int, +) (uint32, error) { + result, err := rw.contract.GetRedemptionDelay( + rw.callerOptions, + arg_redemptionKey, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "getRedemptionDelay", + arg_redemptionKey, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) GetRedemptionDelayAtBlock( + arg_redemptionKey *big.Int, + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "getRedemptionDelay", + &result, + arg_redemptionKey, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) IsBanned( + arg0 common.Address, +) (bool, error) { + result, err := rw.contract.IsBanned( + rw.callerOptions, + arg0, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "isBanned", + arg0, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) IsBannedAtBlock( + arg0 common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "isBanned", + &result, + arg0, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) IsGuardian( + arg0 common.Address, +) (bool, error) { + result, err := rw.contract.IsGuardian( + rw.callerOptions, + arg0, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "isGuardian", + arg0, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) IsGuardianAtBlock( + arg0 common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "isGuardian", + &result, + arg0, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) IsSafeRedemption( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + arg_balanceOwner common.Address, + arg_redeemer common.Address, +) (bool, error) { + result, err := rw.contract.IsSafeRedemption( + rw.callerOptions, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + arg_balanceOwner, + arg_redeemer, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "isSafeRedemption", + arg_walletPubKeyHash, + arg_redeemerOutputScript, + arg_balanceOwner, + arg_redeemer, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) IsSafeRedemptionAtBlock( + arg_walletPubKeyHash [20]byte, + arg_redeemerOutputScript []byte, + arg_balanceOwner common.Address, + arg_redeemer common.Address, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "isSafeRedemption", + &result, + arg_walletPubKeyHash, + arg_redeemerOutputScript, + arg_balanceOwner, + arg_redeemer, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) LevelOneDelay() (uint32, error) { + result, err := rw.contract.LevelOneDelay( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "levelOneDelay", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) LevelOneDelayAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "levelOneDelay", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) LevelTwoDelay() (uint32, error) { + result, err := rw.contract.LevelTwoDelay( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "levelTwoDelay", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) LevelTwoDelayAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "levelTwoDelay", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) Manager() (common.Address, error) { + result, err := rw.contract.Manager( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "manager", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) ManagerAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "manager", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) Objections( + arg0 *big.Int, +) (bool, error) { + result, err := rw.contract.Objections( + rw.callerOptions, + arg0, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "objections", + arg0, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) ObjectionsAtBlock( + arg0 *big.Int, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "objections", + &result, + arg0, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) Owner() (common.Address, error) { + result, err := rw.contract.Owner( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "owner", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) OwnerAtBlock( + blockNumber *big.Int, +) (common.Address, error) { + var result common.Address + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "owner", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) VetoFreezePeriod() (uint32, error) { + result, err := rw.contract.VetoFreezePeriod( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "vetoFreezePeriod", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) VetoFreezePeriodAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "vetoFreezePeriod", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) VetoPenaltyFeeDivisor() (uint64, error) { + result, err := rw.contract.VetoPenaltyFeeDivisor( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "vetoPenaltyFeeDivisor", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) VetoPenaltyFeeDivisorAtBlock( + blockNumber *big.Int, +) (uint64, error) { + var result uint64 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "vetoPenaltyFeeDivisor", + &result, + ) + + return result, err +} + +type vetoProposals struct { + Redeemer common.Address + WithdrawableAmount uint64 + FinalizedAt uint32 + ObjectionsCount uint8 +} + +func (rw *RedemptionWatchtower) VetoProposals( + arg0 *big.Int, +) (vetoProposals, error) { + result, err := rw.contract.VetoProposals( + rw.callerOptions, + arg0, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "vetoProposals", + arg0, + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) VetoProposalsAtBlock( + arg0 *big.Int, + blockNumber *big.Int, +) (vetoProposals, error) { + var result vetoProposals + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "vetoProposals", + &result, + arg0, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) WaivedAmountLimit() (uint64, error) { + result, err := rw.contract.WaivedAmountLimit( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "waivedAmountLimit", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) WaivedAmountLimitAtBlock( + blockNumber *big.Int, +) (uint64, error) { + var result uint64 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "waivedAmountLimit", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerDisabledAt() (uint32, error) { + result, err := rw.contract.WatchtowerDisabledAt( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "watchtowerDisabledAt", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerDisabledAtAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "watchtowerDisabledAt", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerEnabledAt() (uint32, error) { + result, err := rw.contract.WatchtowerEnabledAt( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "watchtowerEnabledAt", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerEnabledAtAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "watchtowerEnabledAt", + &result, + ) + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerLifetime() (uint32, error) { + result, err := rw.contract.WatchtowerLifetime( + rw.callerOptions, + ) + + if err != nil { + return result, rw.errorResolver.ResolveError( + err, + rw.callerOptions.From, + nil, + "watchtowerLifetime", + ) + } + + return result, err +} + +func (rw *RedemptionWatchtower) WatchtowerLifetimeAtBlock( + blockNumber *big.Int, +) (uint32, error) { + var result uint32 + + err := chainutil.CallAtBlock( + rw.callerOptions.From, + blockNumber, + nil, + rw.contractABI, + rw.caller, + rw.errorResolver, + rw.contractAddress, + "watchtowerLifetime", + &result, + ) + + return result, err +} + +// ------ Events ------- + +func (rw *RedemptionWatchtower) BannedEvent( + opts *ethereum.SubscribeOpts, + redeemerFilter []common.Address, +) *RwBannedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwBannedSubscription{ + rw, + opts, + redeemerFilter, + } +} + +type RwBannedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redeemerFilter []common.Address +} + +type redemptionWatchtowerBannedFunc func( + Redeemer common.Address, + blockNumber uint64, +) + +func (bs *RwBannedSubscription) OnEvent( + handler redemptionWatchtowerBannedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerBanned) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.Redeemer, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := bs.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (bs *RwBannedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerBanned, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(bs.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := bs.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - bs.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past Banned events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := bs.contract.PastBannedEvents( + fromBlock, + nil, + bs.redeemerFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past Banned events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := bs.contract.watchBanned( + sink, + bs.redeemerFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchBanned( + sink chan *abi.RedemptionWatchtowerBanned, + redeemerFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchBanned( + &bind.WatchOpts{Context: ctx}, + sink, + redeemerFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event Banned had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event Banned failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastBannedEvents( + startBlock uint64, + endBlock *uint64, + redeemerFilter []common.Address, +) ([]*abi.RedemptionWatchtowerBanned, error) { + iterator, err := rw.contract.FilterBanned( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redeemerFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Banned events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerBanned, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) GuardianAddedEvent( + opts *ethereum.SubscribeOpts, + guardianFilter []common.Address, +) *RwGuardianAddedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwGuardianAddedSubscription{ + rw, + opts, + guardianFilter, + } +} + +type RwGuardianAddedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + guardianFilter []common.Address +} + +type redemptionWatchtowerGuardianAddedFunc func( + Guardian common.Address, + blockNumber uint64, +) + +func (gas *RwGuardianAddedSubscription) OnEvent( + handler redemptionWatchtowerGuardianAddedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerGuardianAdded) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.Guardian, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := gas.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (gas *RwGuardianAddedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerGuardianAdded, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(gas.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := gas.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - gas.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past GuardianAdded events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := gas.contract.PastGuardianAddedEvents( + fromBlock, + nil, + gas.guardianFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past GuardianAdded events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := gas.contract.watchGuardianAdded( + sink, + gas.guardianFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchGuardianAdded( + sink chan *abi.RedemptionWatchtowerGuardianAdded, + guardianFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchGuardianAdded( + &bind.WatchOpts{Context: ctx}, + sink, + guardianFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event GuardianAdded had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event GuardianAdded failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastGuardianAddedEvents( + startBlock uint64, + endBlock *uint64, + guardianFilter []common.Address, +) ([]*abi.RedemptionWatchtowerGuardianAdded, error) { + iterator, err := rw.contract.FilterGuardianAdded( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + guardianFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past GuardianAdded events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerGuardianAdded, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) GuardianRemovedEvent( + opts *ethereum.SubscribeOpts, + guardianFilter []common.Address, +) *RwGuardianRemovedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwGuardianRemovedSubscription{ + rw, + opts, + guardianFilter, + } +} + +type RwGuardianRemovedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + guardianFilter []common.Address +} + +type redemptionWatchtowerGuardianRemovedFunc func( + Guardian common.Address, + blockNumber uint64, +) + +func (grs *RwGuardianRemovedSubscription) OnEvent( + handler redemptionWatchtowerGuardianRemovedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerGuardianRemoved) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.Guardian, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := grs.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (grs *RwGuardianRemovedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerGuardianRemoved, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(grs.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := grs.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - grs.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past GuardianRemoved events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := grs.contract.PastGuardianRemovedEvents( + fromBlock, + nil, + grs.guardianFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past GuardianRemoved events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := grs.contract.watchGuardianRemoved( + sink, + grs.guardianFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchGuardianRemoved( + sink chan *abi.RedemptionWatchtowerGuardianRemoved, + guardianFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchGuardianRemoved( + &bind.WatchOpts{Context: ctx}, + sink, + guardianFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event GuardianRemoved had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event GuardianRemoved failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastGuardianRemovedEvents( + startBlock uint64, + endBlock *uint64, + guardianFilter []common.Address, +) ([]*abi.RedemptionWatchtowerGuardianRemoved, error) { + iterator, err := rw.contract.FilterGuardianRemoved( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + guardianFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past GuardianRemoved events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerGuardianRemoved, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) InitializedEvent( + opts *ethereum.SubscribeOpts, +) *RwInitializedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwInitializedSubscription{ + rw, + opts, + } +} + +type RwInitializedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts +} + +type redemptionWatchtowerInitializedFunc func( + Version uint8, + blockNumber uint64, +) + +func (is *RwInitializedSubscription) OnEvent( + handler redemptionWatchtowerInitializedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerInitialized) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.Version, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := is.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (is *RwInitializedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerInitialized, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(is.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := is.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - is.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past Initialized events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := is.contract.PastInitializedEvents( + fromBlock, + nil, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past Initialized events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := is.contract.watchInitialized( + sink, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchInitialized( + sink chan *abi.RedemptionWatchtowerInitialized, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchInitialized( + &bind.WatchOpts{Context: ctx}, + sink, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event Initialized had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event Initialized failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastInitializedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.RedemptionWatchtowerInitialized, error) { + iterator, err := rw.contract.FilterInitialized( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Initialized events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerInitialized, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) ObjectionRaisedEvent( + opts *ethereum.SubscribeOpts, + redemptionKeyFilter []*big.Int, + guardianFilter []common.Address, +) *RwObjectionRaisedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwObjectionRaisedSubscription{ + rw, + opts, + redemptionKeyFilter, + guardianFilter, + } +} + +type RwObjectionRaisedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redemptionKeyFilter []*big.Int + guardianFilter []common.Address +} + +type redemptionWatchtowerObjectionRaisedFunc func( + RedemptionKey *big.Int, + Guardian common.Address, + blockNumber uint64, +) + +func (ors *RwObjectionRaisedSubscription) OnEvent( + handler redemptionWatchtowerObjectionRaisedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerObjectionRaised) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.RedemptionKey, + event.Guardian, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := ors.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (ors *RwObjectionRaisedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerObjectionRaised, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(ors.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := ors.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - ors.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past ObjectionRaised events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := ors.contract.PastObjectionRaisedEvents( + fromBlock, + nil, + ors.redemptionKeyFilter, + ors.guardianFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past ObjectionRaised events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := ors.contract.watchObjectionRaised( + sink, + ors.redemptionKeyFilter, + ors.guardianFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchObjectionRaised( + sink chan *abi.RedemptionWatchtowerObjectionRaised, + redemptionKeyFilter []*big.Int, + guardianFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchObjectionRaised( + &bind.WatchOpts{Context: ctx}, + sink, + redemptionKeyFilter, + guardianFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event ObjectionRaised had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event ObjectionRaised failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastObjectionRaisedEvents( + startBlock uint64, + endBlock *uint64, + redemptionKeyFilter []*big.Int, + guardianFilter []common.Address, +) ([]*abi.RedemptionWatchtowerObjectionRaised, error) { + iterator, err := rw.contract.FilterObjectionRaised( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redemptionKeyFilter, + guardianFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past ObjectionRaised events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerObjectionRaised, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) OwnershipTransferredEvent( + opts *ethereum.SubscribeOpts, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) *RwOwnershipTransferredSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwOwnershipTransferredSubscription{ + rw, + opts, + previousOwnerFilter, + newOwnerFilter, + } +} + +type RwOwnershipTransferredSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + previousOwnerFilter []common.Address + newOwnerFilter []common.Address +} + +type redemptionWatchtowerOwnershipTransferredFunc func( + PreviousOwner common.Address, + NewOwner common.Address, + blockNumber uint64, +) + +func (ots *RwOwnershipTransferredSubscription) OnEvent( + handler redemptionWatchtowerOwnershipTransferredFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerOwnershipTransferred) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.PreviousOwner, + event.NewOwner, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := ots.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (ots *RwOwnershipTransferredSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerOwnershipTransferred, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(ots.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := ots.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - ots.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past OwnershipTransferred events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := ots.contract.PastOwnershipTransferredEvents( + fromBlock, + nil, + ots.previousOwnerFilter, + ots.newOwnerFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past OwnershipTransferred events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := ots.contract.watchOwnershipTransferred( + sink, + ots.previousOwnerFilter, + ots.newOwnerFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchOwnershipTransferred( + sink chan *abi.RedemptionWatchtowerOwnershipTransferred, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchOwnershipTransferred( + &bind.WatchOpts{Context: ctx}, + sink, + previousOwnerFilter, + newOwnerFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event OwnershipTransferred had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event OwnershipTransferred failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastOwnershipTransferredEvents( + startBlock uint64, + endBlock *uint64, + previousOwnerFilter []common.Address, + newOwnerFilter []common.Address, +) ([]*abi.RedemptionWatchtowerOwnershipTransferred, error) { + iterator, err := rw.contract.FilterOwnershipTransferred( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + previousOwnerFilter, + newOwnerFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past OwnershipTransferred events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerOwnershipTransferred, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) UnbannedEvent( + opts *ethereum.SubscribeOpts, + redeemerFilter []common.Address, +) *RwUnbannedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwUnbannedSubscription{ + rw, + opts, + redeemerFilter, + } +} + +type RwUnbannedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redeemerFilter []common.Address +} + +type redemptionWatchtowerUnbannedFunc func( + Redeemer common.Address, + blockNumber uint64, +) + +func (us *RwUnbannedSubscription) OnEvent( + handler redemptionWatchtowerUnbannedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerUnbanned) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.Redeemer, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := us.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (us *RwUnbannedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerUnbanned, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(us.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := us.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - us.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past Unbanned events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := us.contract.PastUnbannedEvents( + fromBlock, + nil, + us.redeemerFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past Unbanned events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := us.contract.watchUnbanned( + sink, + us.redeemerFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchUnbanned( + sink chan *abi.RedemptionWatchtowerUnbanned, + redeemerFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchUnbanned( + &bind.WatchOpts{Context: ctx}, + sink, + redeemerFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event Unbanned had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event Unbanned failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastUnbannedEvents( + startBlock uint64, + endBlock *uint64, + redeemerFilter []common.Address, +) ([]*abi.RedemptionWatchtowerUnbanned, error) { + iterator, err := rw.contract.FilterUnbanned( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redeemerFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past Unbanned events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerUnbanned, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) VetoFinalizedEvent( + opts *ethereum.SubscribeOpts, + redemptionKeyFilter []*big.Int, +) *RwVetoFinalizedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwVetoFinalizedSubscription{ + rw, + opts, + redemptionKeyFilter, + } +} + +type RwVetoFinalizedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redemptionKeyFilter []*big.Int +} + +type redemptionWatchtowerVetoFinalizedFunc func( + RedemptionKey *big.Int, + blockNumber uint64, +) + +func (vfs *RwVetoFinalizedSubscription) OnEvent( + handler redemptionWatchtowerVetoFinalizedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerVetoFinalized) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.RedemptionKey, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := vfs.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (vfs *RwVetoFinalizedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerVetoFinalized, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(vfs.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := vfs.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - vfs.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past VetoFinalized events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := vfs.contract.PastVetoFinalizedEvents( + fromBlock, + nil, + vfs.redemptionKeyFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past VetoFinalized events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := vfs.contract.watchVetoFinalized( + sink, + vfs.redemptionKeyFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchVetoFinalized( + sink chan *abi.RedemptionWatchtowerVetoFinalized, + redemptionKeyFilter []*big.Int, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchVetoFinalized( + &bind.WatchOpts{Context: ctx}, + sink, + redemptionKeyFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event VetoFinalized had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event VetoFinalized failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastVetoFinalizedEvents( + startBlock uint64, + endBlock *uint64, + redemptionKeyFilter []*big.Int, +) ([]*abi.RedemptionWatchtowerVetoFinalized, error) { + iterator, err := rw.contract.FilterVetoFinalized( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redemptionKeyFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past VetoFinalized events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerVetoFinalized, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) VetoPeriodCheckOmittedEvent( + opts *ethereum.SubscribeOpts, + redemptionKeyFilter []*big.Int, +) *RwVetoPeriodCheckOmittedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwVetoPeriodCheckOmittedSubscription{ + rw, + opts, + redemptionKeyFilter, + } +} + +type RwVetoPeriodCheckOmittedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redemptionKeyFilter []*big.Int +} + +type redemptionWatchtowerVetoPeriodCheckOmittedFunc func( + RedemptionKey *big.Int, + blockNumber uint64, +) + +func (vpcos *RwVetoPeriodCheckOmittedSubscription) OnEvent( + handler redemptionWatchtowerVetoPeriodCheckOmittedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerVetoPeriodCheckOmitted) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.RedemptionKey, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := vpcos.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (vpcos *RwVetoPeriodCheckOmittedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerVetoPeriodCheckOmitted, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(vpcos.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := vpcos.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - vpcos.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past VetoPeriodCheckOmitted events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := vpcos.contract.PastVetoPeriodCheckOmittedEvents( + fromBlock, + nil, + vpcos.redemptionKeyFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past VetoPeriodCheckOmitted events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := vpcos.contract.watchVetoPeriodCheckOmitted( + sink, + vpcos.redemptionKeyFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchVetoPeriodCheckOmitted( + sink chan *abi.RedemptionWatchtowerVetoPeriodCheckOmitted, + redemptionKeyFilter []*big.Int, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchVetoPeriodCheckOmitted( + &bind.WatchOpts{Context: ctx}, + sink, + redemptionKeyFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event VetoPeriodCheckOmitted had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event VetoPeriodCheckOmitted failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastVetoPeriodCheckOmittedEvents( + startBlock uint64, + endBlock *uint64, + redemptionKeyFilter []*big.Int, +) ([]*abi.RedemptionWatchtowerVetoPeriodCheckOmitted, error) { + iterator, err := rw.contract.FilterVetoPeriodCheckOmitted( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redemptionKeyFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past VetoPeriodCheckOmitted events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerVetoPeriodCheckOmitted, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) VetoedFundsWithdrawnEvent( + opts *ethereum.SubscribeOpts, + redemptionKeyFilter []*big.Int, + redeemerFilter []common.Address, +) *RwVetoedFundsWithdrawnSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwVetoedFundsWithdrawnSubscription{ + rw, + opts, + redemptionKeyFilter, + redeemerFilter, + } +} + +type RwVetoedFundsWithdrawnSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts + redemptionKeyFilter []*big.Int + redeemerFilter []common.Address +} + +type redemptionWatchtowerVetoedFundsWithdrawnFunc func( + RedemptionKey *big.Int, + Redeemer common.Address, + Amount uint64, + blockNumber uint64, +) + +func (vfws *RwVetoedFundsWithdrawnSubscription) OnEvent( + handler redemptionWatchtowerVetoedFundsWithdrawnFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerVetoedFundsWithdrawn) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.RedemptionKey, + event.Redeemer, + event.Amount, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := vfws.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (vfws *RwVetoedFundsWithdrawnSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerVetoedFundsWithdrawn, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(vfws.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := vfws.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - vfws.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past VetoedFundsWithdrawn events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := vfws.contract.PastVetoedFundsWithdrawnEvents( + fromBlock, + nil, + vfws.redemptionKeyFilter, + vfws.redeemerFilter, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past VetoedFundsWithdrawn events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := vfws.contract.watchVetoedFundsWithdrawn( + sink, + vfws.redemptionKeyFilter, + vfws.redeemerFilter, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchVetoedFundsWithdrawn( + sink chan *abi.RedemptionWatchtowerVetoedFundsWithdrawn, + redemptionKeyFilter []*big.Int, + redeemerFilter []common.Address, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchVetoedFundsWithdrawn( + &bind.WatchOpts{Context: ctx}, + sink, + redemptionKeyFilter, + redeemerFilter, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event VetoedFundsWithdrawn had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event VetoedFundsWithdrawn failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastVetoedFundsWithdrawnEvents( + startBlock uint64, + endBlock *uint64, + redemptionKeyFilter []*big.Int, + redeemerFilter []common.Address, +) ([]*abi.RedemptionWatchtowerVetoedFundsWithdrawn, error) { + iterator, err := rw.contract.FilterVetoedFundsWithdrawn( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + redemptionKeyFilter, + redeemerFilter, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past VetoedFundsWithdrawn events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerVetoedFundsWithdrawn, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) WatchtowerDisabledEvent( + opts *ethereum.SubscribeOpts, +) *RwWatchtowerDisabledSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwWatchtowerDisabledSubscription{ + rw, + opts, + } +} + +type RwWatchtowerDisabledSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts +} + +type redemptionWatchtowerWatchtowerDisabledFunc func( + DisabledAt uint32, + Executor common.Address, + blockNumber uint64, +) + +func (wds *RwWatchtowerDisabledSubscription) OnEvent( + handler redemptionWatchtowerWatchtowerDisabledFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerWatchtowerDisabled) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.DisabledAt, + event.Executor, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := wds.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (wds *RwWatchtowerDisabledSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerWatchtowerDisabled, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(wds.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := wds.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - wds.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past WatchtowerDisabled events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := wds.contract.PastWatchtowerDisabledEvents( + fromBlock, + nil, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past WatchtowerDisabled events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := wds.contract.watchWatchtowerDisabled( + sink, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchWatchtowerDisabled( + sink chan *abi.RedemptionWatchtowerWatchtowerDisabled, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchWatchtowerDisabled( + &bind.WatchOpts{Context: ctx}, + sink, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event WatchtowerDisabled had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event WatchtowerDisabled failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastWatchtowerDisabledEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.RedemptionWatchtowerWatchtowerDisabled, error) { + iterator, err := rw.contract.FilterWatchtowerDisabled( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past WatchtowerDisabled events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerWatchtowerDisabled, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) WatchtowerEnabledEvent( + opts *ethereum.SubscribeOpts, +) *RwWatchtowerEnabledSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwWatchtowerEnabledSubscription{ + rw, + opts, + } +} + +type RwWatchtowerEnabledSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts +} + +type redemptionWatchtowerWatchtowerEnabledFunc func( + EnabledAt uint32, + Manager common.Address, + blockNumber uint64, +) + +func (wes *RwWatchtowerEnabledSubscription) OnEvent( + handler redemptionWatchtowerWatchtowerEnabledFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerWatchtowerEnabled) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.EnabledAt, + event.Manager, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := wes.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (wes *RwWatchtowerEnabledSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerWatchtowerEnabled, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(wes.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := wes.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - wes.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past WatchtowerEnabled events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := wes.contract.PastWatchtowerEnabledEvents( + fromBlock, + nil, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past WatchtowerEnabled events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := wes.contract.watchWatchtowerEnabled( + sink, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchWatchtowerEnabled( + sink chan *abi.RedemptionWatchtowerWatchtowerEnabled, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchWatchtowerEnabled( + &bind.WatchOpts{Context: ctx}, + sink, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event WatchtowerEnabled had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event WatchtowerEnabled failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastWatchtowerEnabledEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.RedemptionWatchtowerWatchtowerEnabled, error) { + iterator, err := rw.contract.FilterWatchtowerEnabled( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past WatchtowerEnabled events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerWatchtowerEnabled, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} + +func (rw *RedemptionWatchtower) WatchtowerParametersUpdatedEvent( + opts *ethereum.SubscribeOpts, +) *RwWatchtowerParametersUpdatedSubscription { + if opts == nil { + opts = new(ethereum.SubscribeOpts) + } + if opts.Tick == 0 { + opts.Tick = chainutil.DefaultSubscribeOptsTick + } + if opts.PastBlocks == 0 { + opts.PastBlocks = chainutil.DefaultSubscribeOptsPastBlocks + } + + return &RwWatchtowerParametersUpdatedSubscription{ + rw, + opts, + } +} + +type RwWatchtowerParametersUpdatedSubscription struct { + contract *RedemptionWatchtower + opts *ethereum.SubscribeOpts +} + +type redemptionWatchtowerWatchtowerParametersUpdatedFunc func( + WatchtowerLifetime uint32, + VetoPenaltyFeeDivisor uint64, + VetoFreezePeriod uint32, + DefaultDelay uint32, + LevelOneDelay uint32, + LevelTwoDelay uint32, + WaivedAmountLimit uint64, + blockNumber uint64, +) + +func (wpus *RwWatchtowerParametersUpdatedSubscription) OnEvent( + handler redemptionWatchtowerWatchtowerParametersUpdatedFunc, +) subscription.EventSubscription { + eventChan := make(chan *abi.RedemptionWatchtowerWatchtowerParametersUpdated) + ctx, cancelCtx := context.WithCancel(context.Background()) + + go func() { + for { + select { + case <-ctx.Done(): + return + case event := <-eventChan: + handler( + event.WatchtowerLifetime, + event.VetoPenaltyFeeDivisor, + event.VetoFreezePeriod, + event.DefaultDelay, + event.LevelOneDelay, + event.LevelTwoDelay, + event.WaivedAmountLimit, + event.Raw.BlockNumber, + ) + } + } + }() + + sub := wpus.Pipe(eventChan) + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (wpus *RwWatchtowerParametersUpdatedSubscription) Pipe( + sink chan *abi.RedemptionWatchtowerWatchtowerParametersUpdated, +) subscription.EventSubscription { + ctx, cancelCtx := context.WithCancel(context.Background()) + go func() { + ticker := time.NewTicker(wpus.opts.Tick) + defer ticker.Stop() + for { + select { + case <-ctx.Done(): + return + case <-ticker.C: + lastBlock, err := wpus.contract.blockCounter.CurrentBlock() + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + } + fromBlock := lastBlock - wpus.opts.PastBlocks + + rwLogger.Infof( + "subscription monitoring fetching past WatchtowerParametersUpdated events "+ + "starting from block [%v]", + fromBlock, + ) + events, err := wpus.contract.PastWatchtowerParametersUpdatedEvents( + fromBlock, + nil, + ) + if err != nil { + rwLogger.Errorf( + "subscription failed to pull events: [%v]", + err, + ) + continue + } + rwLogger.Infof( + "subscription monitoring fetched [%v] past WatchtowerParametersUpdated events", + len(events), + ) + + for _, event := range events { + sink <- event + } + } + } + }() + + sub := wpus.contract.watchWatchtowerParametersUpdated( + sink, + ) + + return subscription.NewEventSubscription(func() { + sub.Unsubscribe() + cancelCtx() + }) +} + +func (rw *RedemptionWatchtower) watchWatchtowerParametersUpdated( + sink chan *abi.RedemptionWatchtowerWatchtowerParametersUpdated, +) event.Subscription { + subscribeFn := func(ctx context.Context) (event.Subscription, error) { + return rw.contract.WatchWatchtowerParametersUpdated( + &bind.WatchOpts{Context: ctx}, + sink, + ) + } + + thresholdViolatedFn := func(elapsed time.Duration) { + rwLogger.Warnf( + "subscription to event WatchtowerParametersUpdated had to be "+ + "retried [%s] since the last attempt; please inspect "+ + "host chain connectivity", + elapsed, + ) + } + + subscriptionFailedFn := func(err error) { + rwLogger.Errorf( + "subscription to event WatchtowerParametersUpdated failed "+ + "with error: [%v]; resubscription attempt will be "+ + "performed", + err, + ) + } + + return chainutil.WithResubscription( + chainutil.SubscriptionBackoffMax, + subscribeFn, + chainutil.SubscriptionAlertThreshold, + thresholdViolatedFn, + subscriptionFailedFn, + ) +} + +func (rw *RedemptionWatchtower) PastWatchtowerParametersUpdatedEvents( + startBlock uint64, + endBlock *uint64, +) ([]*abi.RedemptionWatchtowerWatchtowerParametersUpdated, error) { + iterator, err := rw.contract.FilterWatchtowerParametersUpdated( + &bind.FilterOpts{ + Start: startBlock, + End: endBlock, + }, + ) + if err != nil { + return nil, fmt.Errorf( + "error retrieving past WatchtowerParametersUpdated events: [%v]", + err, + ) + } + + events := make([]*abi.RedemptionWatchtowerWatchtowerParametersUpdated, 0) + + for iterator.Next() { + event := iterator.Event + events = append(events, event) + } + + return events, nil +} diff --git a/pkg/chain/ethereum/tbtc/gen/contract/WalletProposalValidator.go b/pkg/chain/ethereum/tbtc/gen/contract/WalletProposalValidator.go index c79f04f4f9..b5d3591e01 100644 --- a/pkg/chain/ethereum/tbtc/gen/contract/WalletProposalValidator.go +++ b/pkg/chain/ethereum/tbtc/gen/contract/WalletProposalValidator.go @@ -451,6 +451,49 @@ func (wpv *WalletProposalValidator) ValidateHeartbeatProposalAtBlock( return result, err } +func (wpv *WalletProposalValidator) ValidateMovedFundsSweepProposal( + arg_proposal abi.WalletProposalValidatorMovedFundsSweepProposal, +) (bool, error) { + result, err := wpv.contract.ValidateMovedFundsSweepProposal( + wpv.callerOptions, + arg_proposal, + ) + + if err != nil { + return result, wpv.errorResolver.ResolveError( + err, + wpv.callerOptions.From, + nil, + "validateMovedFundsSweepProposal", + arg_proposal, + ) + } + + return result, err +} + +func (wpv *WalletProposalValidator) ValidateMovedFundsSweepProposalAtBlock( + arg_proposal abi.WalletProposalValidatorMovedFundsSweepProposal, + blockNumber *big.Int, +) (bool, error) { + var result bool + + err := chainutil.CallAtBlock( + wpv.callerOptions.From, + blockNumber, + nil, + wpv.contractABI, + wpv.caller, + wpv.errorResolver, + wpv.contractAddress, + "validateMovedFundsSweepProposal", + &result, + arg_proposal, + ) + + return result, err +} + func (wpv *WalletProposalValidator) ValidateMovingFundsProposal( arg_proposal abi.WalletProposalValidatorMovingFundsProposal, arg_walletMainUtxo abi.BitcoinTxUTXO3,